Closed ryandesign closed 7 years ago
A new internal header <zzip/__string.h> has been introduced to handle a missing strndup().
Please check the current master branch again.
Also reported to need a fix on mingw.
Probably fixed by now, feel free to reopen an issue otherwise.
Might have been fixed back in 2017, but it's an issue with the most recent release 0.13.69
gcc -DHAVE_CONFIG_H -I.. -I../.. -O2 -D_USE_MMAP -fomit-frame-pointer -Wall -Wpointer-arith -Wsign-compare -Wmissing-declarations -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wstrict-aliasing -Wstrict-prototypes -MT unzzipcat-zip.o -MD -MP -MF .deps/unzzipcat-zip.Tpo -c -o unzzipcat-zip.o ../../bins/unzzipcat-zip.c
../../bins/unzzipcat-zip.c: In function ‘makedirs’:
../../bins/unzzipcat-zip.c:76: error: implicit declaration of function ‘strndup’
../../bins/unzzipcat-zip.c:76: warning: incompatible implicit declaration of built-in function ‘strndup’
../../bins/unzzipcat-zip.c: In function ‘create_fopen’:
../../bins/unzzipcat-zip.c:93: warning: incompatible implicit declaration of built-in function ‘strndup’
make[3]: *** [unzzipcat-zip.o] Error 1
Incidentally, for some reason the builds aren't produced with -O2, so we had to add that by setting CFLAGS explicitly. It has no relation to the error.
libzzip 0.13.66 fails to build on older systems, such as Mac OS X 10.6 Snow Leopard and earlier, that do not have the
strndup
function:You should either avoid using this function or provide a compatibility implementation when needed.
See https://trac.macports.org/ticket/54227 for the MacPorts project's bug report on this issue.