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: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2007 19:17:15 -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 #22 from pcarlini at suse dot de 2007-03-15 19:17 -------
(In reply to comment #21)
> (In reply to comment #17)
> > Why?
>
> OK, now I know why. Reason is that os_defines.h is included after errno.h.
Oh yes, you are totally right. The problem is that <cerrno> is one of the very
few c headers not including <bits/c++config.h> first. We can easily fix that.
> I also now know why basic_file.cc gets the errno function:
> /usr/include/sys/feature_tests.h defines _POSIX_C_SOURCE to 199506L,
Ok, but on other targets I don't think we can trust locale.h to always include
something similar and enable the thread safe errno.
Thus, my preference goes for the plan of adding that define in os_defines.h (+
adjusting <cerrno> of course). Are you positive about figuring out something
similar to _TS_ERRNO for the other targets?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31117