tleguern/lgpng

macOS compile warnings

grylem opened this issue · 7 comments

Hi
pnginfo.c:592:33: warning: passing 'char *' to parameter of type 'const Bytef *' (aka 'const unsigned char *') converts
between pointers to integer types with different sign [-Wpointer-sign]
zret = uncompress(out, &outz, ztxt->text, ztxtz);
^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/zlib.h:1276:49: note:
passing argument to parameter 'source' here
const Bytef *source, uLong sourceLen));

and

compats.c:122:8: warning: implicit declaration of function 'memset_s' is invalid in C99 [-Wimplicit-function-declaration]
(void)memset_s(p, n, 0, n);
^
compats.c:122:8: warning: this function declaration is not a prototype [-Wstrict-prototypes]

Regards.

Hello,

Can you provide the config.log fragment starting with the line memset_s: testing... please? If it this function is included in your build it means it is provided by your libc and thus should not be a problem.

Hi
of course:
memset_s: testing...
cc -g -W -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -Wno-unused -Werror -DTEST_MEMSET_S -o test-memset_s tests.c
memset_s: cc succeeded
memset_s: yes

Thanks. I did not know OS X had the C11 function memset_s, but as I don't need it I will just trim the configure script to not include its definition automatically. The first part of the issue should be fixed.

The first part of the issue should be fixed.

Yes iit's fixed. Thanks.

Second part should be fixed too now. Can you check please?

now the configure script is not working well
./configure
make
lgpng.c:409:11: warning: implicit declaration of function 'reallocarray'.......
.....
7 warnings generated.

compats.c:445:1: warning: no previous prototype for function 'explicit_bzero'....
compats.c:543:25: error: use of undeclared identifier 'MD5_BLOCK_LENGTH'
4 warnings and 20 errors generated.

Closing this one then, thanks!