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:37:29 -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 #24 from pcarlini at suse dot de 2007-03-15 19:37 -------
(In reply to comment #23)
> (In reply to comment #22)
>
> > 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.
>
> Why did <cerrno> not include <bits/c++config.h>? Was this intentional?
No need, so far.
> > 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.
>
> I agree. They're all going to be different. But the evidence from basic_file.o
> indicates that they all do something.
Probably including <clocale> very early would fix most in practice, but in
general we don't want to have a behavior depending on such order, that's ugly
and will fire back sooner or later.
> > 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?
>
> Instead of _TS_ERRNO and equivalent, how about including <bits/c++config.h> in
> <cerrno>? That appears sufficient for basic_file.o to be compiled correctly,
> and it appears to work on the platforms I investigated.
Oh, that's excellent news, because we have to include <bits/c++config.h> first
in <cerrno> anyway... But now you make me curious!!! If you look at c++config.h
it doesn't appear do much related to this issue. Before doing just that and
closing the PR, *please* investigate a bit which specific defines get included
by c++config.h and from where!
> What do you mean by "are you positive"?
Ok, my english is still weak ;) Confident?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31117