------- Comment #21 from craig dot lawson at centrify dot com 2007-03-15 19:07
-------
(In reply to comment #17)
> Why?
OK, now I know why. Reason is that os_defines.h is included after errno.h.
Here's the include sequence:
c++locale.cc
<cerrno>
/usr/include/errno.h <-- extern int errno
<cmath>
<bits/c++config.h>
<os_defines.h> <-- _TS_ERRNO -- too late
I also now know why basic_file.cc gets the errno function:
/usr/include/sys/feature_tests.h defines _POSIX_C_SOURCE to 199506L, and that's
what errno.h needs. When compiling c++locale.cc, _POSIX_C_SOURCE is also set to
the same value, but it happens after errno.h is processed.
Thanks Andrew for -dD. That's a good one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31117