Travis Vitek wrote:
Martin Sebor wrote:
Travis Vitek wrote:
I've run into a problem while migrating the cstdint/stdint.h
headers to their new home in the include/ansi directory for
4.3.x.
[...]
The problem is that the system /usr/include/stdint.h defines the
appropriate types [int8_t, uint8_t, ...], but it only defines
the limit macros [PTRDIFF_MAX, ...] if compiling as C or if
__STDC_LIMIT_MACROS is defined. So we get into the final block,
include the system header, but none of the macros come through.
At the very least this causes a bunch of failed assertions in
the test, but due to some minor issues with the test it actually
fails to compile when these macros aren't defined.
Now I could easily just #define __STDC_LIMIT_MACROS for gcc before
including /usr/include/stdint.h [or in rw/_config-gcc.h], but that
wouldn't help much if the user included the system header before our
header.
How could they do that?
Well, I would have expected that this would come up if the user did
something like this
gcc -I/usr/include $(TOPDIR)/include/ansi \
-I$(TOPDIR)/include $(BUILDDIR)/include -c t.cpp
That's not allowed, either by us or by most compiler vendors.
Martin
I did some testing, and for some reason I can't get it to pull the
<stdint.h> from /usr/include by doing this. I guess I'm worrying about
nothing.
Martin