This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/31117] c++locale.o thread-unsafe in libstdc++
- From: "craig dot lawson at centrify dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2007 19:07:53 -0000
- Subject: [Bug libstdc++/31117] c++locale.o thread-unsafe in libstdc++
- References: <bug-31117-9156@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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