[Bug libstdc++/31117] c++locale.o thread-unsafe in libstdc++
pcarlini at suse dot de
gcc-bugzilla@gcc.gnu.org
Thu Mar 15 19:37:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list