Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-10-30 Thread Jonathan Wakely
On 30 October 2012 10:11, Jonathan Wakely wrote: > On 30 October 2012 09:28, Jonathan Wakely wrote: >> On 30 October 2012 09:05, Michael Haubenwallner wrote: >>> Any chance to get this in for 4.8? >> >> I'm looking into it today. > > Consider the case where one object file containing > std::string(

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-10-30 Thread Jonathan Wakely
On 30 October 2012 09:28, Jonathan Wakely wrote: > On 30 October 2012 09:05, Michael Haubenwallner wrote: >> Any chance to get this in for 4.8? > > I'm looking into it today. Consider the case where one object file containing std::string().erase() is built with an older GCC without the fix for PR

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-10-30 Thread Jonathan Wakely
On 30 October 2012 09:05, Michael Haubenwallner wrote: > Any chance to get this in for 4.8? I'm looking into it today.

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-10-30 Thread Michael Haubenwallner
On 08/30/2012 11:45 AM, Jonathan Wakely wrote: > On 29 August 2012 13:25, Michael Haubenwallner wrote: >> On 08/28/2012 08:12 PM, Jonathan Wakely wrote: >>> On 28 August 2012 18:27, Michael Haubenwallner wrote: > > Does it actually produce a segfault? I suppose it might on some > platf

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-08-30 Thread Jonathan Wakely
On 29 August 2012 13:25, Michael Haubenwallner wrote: > > On 08/28/2012 08:12 PM, Jonathan Wakely wrote: >> On 28 August 2012 18:27, Michael Haubenwallner wrote: Does it actually produce a segfault? I suppose it might on some platforms, but not all, so I'm not sure it's worth changin

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-08-29 Thread Michael Haubenwallner
On 08/28/2012 08:12 PM, Jonathan Wakely wrote: > On 28 August 2012 18:27, Michael Haubenwallner wrote: >>> >>> Does it actually produce a segfault? I suppose it might on some >>> platforms, but not all, so I'm not sure it's worth changing. >> >> It does segfault here on (32bit each): >> i686-pc-l

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-08-28 Thread Jonathan Wakely
On 28 August 2012 18:27, Michael Haubenwallner wrote: >> >> Does it actually produce a segfault? I suppose it might on some >> platforms, but not all, so I'm not sure it's worth changing. > > It does segfault here on (32bit each): > i686-pc-linux-gnu > ia64-hp-hpux11.31 > i386-pc-solaris2.10 >

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-08-28 Thread Michael Haubenwallner
On 08/28/2012 06:46 PM, Jonathan Wakely wrote: > On 28 August 2012 16:15, Michael Haubenwallner wrote: >> Hi, >> >> in some old, large, originally C-written application (using gcc-4.2.4 still) >> I did have to find a bug that boils down to something like this: >> >>std::string x; >>strcpy(

Re: [PATCH, libstdc++] Make empty std::string storage readonly

2012-08-28 Thread Jonathan Wakely
On 28 August 2012 16:15, Michael Haubenwallner wrote: > Hi, > > in some old, large, originally C-written application (using gcc-4.2.4 still) > I did have to find a bug that boils down to something like this: > >std::string x; >strcpy( (char*) x.c_str(), "abc"); > > Any subsequent empty std:

[PATCH, libstdc++] Make empty std::string storage readonly

2012-08-28 Thread Michael Haubenwallner
Hi, in some old, large, originally C-written application (using gcc-4.2.4 still) I did have to find a bug that boils down to something like this: std::string x; strcpy( (char*) x.c_str(), "abc"); Any subsequent empty std::string instance did contain "abc" instead of "", which was the issue