[Zlib-devel] zlib 1.2.4 released
Mark Adler
madler at alumni.caltech.edu
Sat Mar 20 13:02:26 EDT 2010
On Mar 15, 2010, at 7:45 AM, Nelson H. F. Beebe wrote:
> I then looked at the source file, and see this:
>
> #ifdef STDC
> #include <stdarg.h>
> ...
>
> The symbol STDC is evidently not defined in a cc compilation.
...
> So, we have a workaround on this system: use c89 or gcc instead of cc.
STDC is a zlib internal define used to identify C compilers that are standard enough for zlib, but that don't define __STDC__. So instead of the workaround, if someone wants to use cc, a fix would be something like this:
#if defined(SOME_SYMBOL_THAT_INDICATES_THE_DEC_CC) && !defined(STDC)
# define STDC
#endif
Can you find SOME_SYMBOL_THAT_INDICATES_THE_DEC_CC?
> I think that the code should have a minor revision to test, possible
> with assert(), that sizeof(int) == sizeof(void *), before accepting
> the varargs workaround in gzwrite.c. Alternatively, the configure
> script could make a test on the sizes of pointers versus integers.
Even if integers and pointers have the same size, you will still run into the same problem with other size objects that can be passed to printf-ish functions, like long longs. I'm thinking that maybe I should just have zlib not even try to provide a gzprintf() if it can't find a variable argument facility.
Mark
More information about the Zlib-devel
mailing list