[Zlib-devel] zlib 1.2.6.1

jbowler at acm.org jbowler at acm.org
Tue Feb 14 15:53:06 EST 2012


> The no definition should be fixed.  Can you find in what header file on that system those functions
>are defined.  It didn't complain about open() or read()?

The warnings were:

deflate.c(1404): Warning! W201: Unreachable code
gzlib.c(204): Warning! W131: No prototype found for function '_lseeki64'
gzread.c(30): Warning! W131: No prototype found for function 'read'
gzread.c(575): Warning! W131: No prototype found for function 'close'
gzwrite.c(84): Warning! W131: No prototype found for function 'write'
gzwrite.c(558): Warning! W131: No prototype found for function 'close'

>From the POSIX 1003.1 standard "open" is declared in fcntl.h, which presumably has got included somewhere, whereas read, write and close being non-stdarg functions returning (int) need not be declared.  BTW, I have the "-w4" warning level; I probably wouldn't get the warnings otherwise.

Anyway, I added -dHAVE_UNISTD_H to the C command line and all the "no prototype" warnings disappeared, therefore all those functions (including _lseeki64) are declared in <unistd.h>.  (In other words I only got the warnings because I switched on no-prototype warnings *and* I didn't configure the build by setting HAVE_UNISTD_H.)

Everything builds ok (with or without HAVE_UNISTD_H) and seems to run (though I have to redirect stdout to see anything from example.c - presumably my OpenWatcom project is set up to build a window app not a command line one, or something like that.)

John Bowler <jbowler at acm.org>






More information about the Zlib-devel mailing list