-
Notifications
You must be signed in to change notification settings - Fork 32
Not compiling on C23 with [-Wincompatible-pointer-types] (probably N2841) #69
Copy link
Copy link
Open
Description
Clean build of https://untroubled.org/daemontools-encore/daemontools-encore-1.11.tar.gz with gcc-14 and with gcc-15 using make CFLAGS="-std=gnu23":
rm -f $( cat TARGETS )
sh find-systype.sh > systype
rm -f load
sh print-ld.sh > load
chmod 555 load
rm -f compile
sh print-cc.sh > compile
chmod 555 compile
rm -f choose
cat warn-auto.sh choose.sh > choose
chmod 555 choose
./choose c trydrent direntry.h1 direntry.h2 > direntry.h
./choose c tryattribute hasattribute.h1 hasattribute.h2 > hasattribute.h
./compile envdir.c
rm -f makelib
sh print-ar.sh > makelib
chmod 555 makelib
./compile alloc.c
./compile alloc_re.c
./compile buffer.c
./compile buffer_0.c
buffer_0.c: In function ‘buffer_0_read’:
buffer_0.c:5:5: warning: old-style function definition [-Wold-style-definition]
5 | int buffer_0_read(fd,buf,len) int fd; char *buf; int len;
| ^~~~~~~~~~~~~
./compile buffer_1.c
In file included from buffer_1.c:3:
buffer.h:14:61: error: initialization of ‘int (*)(void)’ from incompatible pointer type ‘int (*)(int, const char *, unsigned int)’ [-Wincompatible-pointer-types]
14 | #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
| ^
buffer_1.c:6:20: note: in expansion of macro ‘BUFFER_INIT’
6 | static buffer it = BUFFER_INIT(buffer_unixwrite,1,buffer_1_space,sizeof buffer_1_space);
| ^~~~~~~~~~~
buffer.h:14:61: note: (near initialization for ‘it.op’)
14 | #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
| ^
buffer_1.c:6:20: note: in expansion of macro ‘BUFFER_INIT’
6 | static buffer it = BUFFER_INIT(buffer_unixwrite,1,buffer_1_space,sizeof buffer_1_space);
| ^~~~~~~~~~~
buffer.h:55:12: note: ‘buffer_unixwrite’ declared here
55 | extern int buffer_unixwrite(int,const char *,unsigned int);
| ^~~~~~~~~~~~~~~~
make: *** [Makefile:23: buffer_1.o] Error 1
Attached a complicated patch fixing this issue by explicitly specifying the complete argument list everywhere, not sure if easier option is available. The standard seems to leave no other option:
daemontools-encore-1.11.patch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels