
2010/1/6 John Maddock <john@johnmaddock.co.uk>:
Looks like gcc on Darwin is producing warnings from cstdint.hpp that regular gcc on Linux doesn't - I thought I had all those warnings quashed as well :-(
Any Darwin developers got any ideas?
I think it's a bug in the gcc 4.0 library, not a darwin bug (it doesn't happen in darwin 4.2). This is what happens: #include <vector> // In cstdint.hpp: #define __STDC_CONSTANT_MACROS #include <stdint.h> 'vector' includes 'stdint.h' before __STDC_CONSTANT_MACROS is defined, so the macro has no effect and the integer constant macros (INT8_C etc) aren't defined. So boost's version is used which causes the warning. The easy workaround is to define the system header pragma immediately before the warning is generated (patch attached). Technically, there's an ODR violation since INT8_C can be defined differently in different units, but I don't think that's a real problem. Daniel