This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/21334] Lack of Posix compliant thread safety in std::basic_string
- From: "james dot kanze at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 May 2007 15:21:47 -0000
- Subject: [Bug libstdc++/21334] Lack of Posix compliant thread safety in std::basic_string
- References: <bug-21334-9635@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #38 from james dot kanze at gmail dot com 2007-05-08 16:21 -------
Subject: Re: Lack of Posix compliant thread safety in std::basic_string
On 8 May 2007 05:24:35 -0000, gianni at mariani dot ws
<gcc-bugzilla@gcc.gnu.org> wrote:
> ------- Comment #36 from gianni at mariani dot ws 2007-05-08 06:24 -------
> BTW - you don't need a multi-threaded test to make this problem show up.
> The code below is plain old C++ and breaks. Again, I hesitate
> in calling this one a bug because begin() on a non-const
> object make be "allowed" to invalidate previous const
> iterators, I'm not sure.
In this case, the standard specifically says that the code is
invalid. (For all of the standard containers, the standard
specifies what operations invalidate iterators.)
> If it is not allowed to then this is
> a legitimate bug - no threads needed. BTW, this test works on:
> "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42"
As does my example:-). Different implementations will behave
differently.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21334