[Zlib-devel] [PATCH] Move gzflags to zutil.c

jbowler at acm.org jbowler at acm.org
Thu Feb 2 02:34:27 EST 2012


From: zlib-devel-bounces at madler.net [mailto:zlib-devel-bounces at madler.net] On Behalf Of Mark Adler
>Did you do ./configure --solo?

No; this is under Visual Studio 2010 on Windows (pure windows; the cygwin directory below is irrelevant), so I can't run a shell script.

>What is the non-ANSI compliant declaration you are seeing?  On what compiler with what message?  

2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(436): warning C4142: benign redefinition of type

Which is fine (well, I treat all warnings as errors, but I can disable 4142 easily), but then on the x64 build:

2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(434): error C2371: 'ptrdiff_t' : redefinition; different basic types
2>          g:\cygwin\home\jbowler\vstudio\zlib-1.2.6\zutil.h(33) : see declaration of 'ptrdiff_t'

It's in the compilation of "crc32.c".  The standard header files included (according to the Visual Studio highlighting, which can sometimes be out of date but is, I think, correct in this case):

#include <limits.h>  /* From crc32.c */

STDC is defined.  It is *only* crc32.c that has this problem, which is really weird; files like adler32.c which also include zutil.h compile just fine (on both 32-bit and 64-bit).

>According to the C99 standard, ptrdiff_t is defined in stddef.h.  
>So if stddef.h is not #included (and for Z_SOLO, nothing is #included),
>then you could define ptrdiff_t to be whatever you like.

Indeed; C89/C90 is the same (ptrdiff_t is only defined in stddef.h)

I will investigate more.

John Bowler <jbowler at acm.org>





More information about the Zlib-devel mailing list