Menu

#20 suggestion to fix many warnings on cygwin

open
nobody
None
5
2003-03-16
2003-03-16
No

I see zillions of warnings like so:

bltHash.h:75: warning: redefinition of `uint32_t'
/usr/include/cygwin/types.h:141: warning: `uint32_t'
previously declared here
gcc -c -Wall -O6 -DWIN32 -I. -I../../src
-I../../src/../win ../../src/bltParse.c
In file included from ../../src/blt.h:54,
from ../../src/bltInt.h:79,
from ../../src/bltParse.c:20:

This is the relevant bit from my
/usr/include/cygwin/types.h

#ifndef __uint32_t_defined
#define __uint32_t_defined
typedef __uint32_t uint32_t;

I looked at bltHash.h, wondering what it would be like
to put in some cygwin-specific ifdefs, but what is in
there now seems to assume that int32_t is defined in
cygwin, but uint32 is not. This isn't true on my
cygwin at least.

Perhaps this:

#if !defined(__CYGWIN__) || !defined(__int32_t_defined)
typedef signed int int32_t;
#endif
#if !defined(__CYGWIN__) || !defined(__uint32_t_defined)
typedef unsigned int uint32_t;
#endif

I used this section above in my bld/src/bltHash.h and
the warnings are gone.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.