csound / csound_pd

Csound for Pure Data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static declaration of ‘error’ follows non-static declaration

johannphilippe opened this issue · comments

System : Linux Mint 20
Csound 6.18

/home/johann/Documents/GitHub/csound_pd/src/csoundapi_tilde.c:40:13: error: static declaration of ‘error’ follows non-static declaration
   40 | static void error(const char *fmt,...) {
      |             ^~~~~
In file included from /home/johann/Documents/GitHub/csound_pd/src/csoundapi_tilde.c:27:
/usr/include/m_pd.h:537:13: note: previous declaration of ‘error’ was here
  537 | EXTERN void error(const char *fmt, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
      |             ^~~~~
make[2]: *** [CMakeFiles/pdcsound.dir/build.make:79: CMakeFiles/pdcsound.dir/src/csoundapi_tilde.c.o] Error 1
make[2]: Leaving directory '/home/johann/Documents/GitHub/csound_pd/build'
make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/pdcsound.dir/all] Error 2
make[1]: Leaving directory '/home/johann/Documents/GitHub/csound_pd/build'
make: *** [Makefile:94: all] Error 2

removing the static attribute in csoundapi_tilde.c solved the issue.

It depends on the version of the pd header. Some have that function, others don't. I'll probably have to rename it to fix it for all.

the proper fix is to replace all occurences of error(...) with pd_error(x, ...).

The error() function has been removed from the Pd headers as it clashes with the error symbol of various system libraries.

pd_error() takes a reference to the object that emit the error, which can be NULL.

good to know, thanks. I can fix the file now.