agraef/purr-data

Windows compile error with gcc 14

agraef opened this issue · 1 comments

As reported by Ayush Anand: With the latest msys/mingw version on Windows at least, compilation fails early on with:

gcc -DPD -DPD_INTERNAL -DMSW -DPA_USE_ASIO -DPA_USE_WMME -DWINVER=0x0502 -DUSEAPI_MMIO -DUSEAPI_PORTAUDIO -mms-bitfields -DWISHAPP='"wish85.exe"' -D__USE_MINGW_ANSI_STDIO=1 -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch  -O3 -funroll-loops -fomit-frame-pointer  -DINSTALL_PREFIX=\"..\" -I../../pd/src  -c -o m_obj.o m_obj.c 
In file included from m_obj.c:9:
m_obj.c: In function 'inlet_fwd':
m_pd.h:349:67: error: passing argument 3 of '(void (*)(void *, void *, void *, void *))getfn(x->i_dest,  gensym((const char *)"fwd"))' makes pointer from integer without a cast [-Wint-conversion]
  349 | #define mess3(x, s, a,b,c) ((*(t_gotfn3)getfn((x), (s)))((x), (a),(b),(c)))
      |                                                                   ^~~
      |                                                                   |
      |                                                                   int
m_obj.c:89:9: note: in expansion of macro 'mess3'
   89 |         mess3(x->i_dest, gensym("fwd"), s, argc, argv);
      |         ^~~~~
m_pd.h:349:67: note: expected 'void *' but argument is of type 'int'
  349 | #define mess3(x, s, a,b,c) ((*(t_gotfn3)getfn((x), (s)))((x), (a),(b),(c)))
      |                                                                   ^~~
m_obj.c:89:9: note: in expansion of macro 'mess3'
   89 |         mess3(x->i_dest, gensym("fwd"), s, argc, argv);
      |         ^~~~~
make[2]: *** [makefile.mingw:177: m_obj.o] Error 1
make[2]: Leaving directory '/home/pd/purr-data/pd/src'
make[1]: *** [Makefile:56: build_pd] Error 2

For the time being, a work-around is to use CFLAGS=-fpermissive when compiling, but we really need to look into this and eliminate the root cause. Also, it seems that Gem compilation fails on Windows now, so we need to look into this as well.

Fixed in rev. 2dbaedc.