This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/8716: std::string( NULL, 0 ) throws exception also on zero length
- From: "Joacim Zschimmer" <x at zsch dot de>
- To: <pme at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Cc: "Paolo Carlini" <pcarlini at unitus dot it>
- Date: Wed, 27 Nov 2002 18:40:10 +0100
- Subject: Re: libstdc++/8716: std::string( NULL, 0 ) throws exception also on zero length
- Organization: Zschimmer GmbH
- References: <20021126163706.11057.qmail@sources.redhat.com>
Yes, the new gcc 3.2.1 hasn't the problem. Very good.
Thank you!
Joacim Zschimmer
-----Ursprüngliche Nachricht-----
Von: <pme@gcc.gnu.org>
An: <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <nobody@gcc.gnu.org>; <pme@gcc.gnu.org>; <x@zsch.de>
Gesendet: Dienstag, 26. November 2002 17:37
Betreff: Re: libstdc++/8716: std::string( NULL, 0 ) throws exception also on zero length
> Synopsis: std::string( NULL, 0 ) throws exception also on zero length
>
> Responsible-Changed-From-To: unassigned->pme
> Responsible-Changed-By: pme
> Responsible-Changed-When: Tue Nov 26 08:37:05 2002
> Responsible-Changed-Why:
> I changed it.
> State-Changed-From-To: open->feedback
> State-Changed-By: pme
> State-Changed-When: Tue Nov 26 08:37:05 2002
> State-Changed-Why:
> Thank you for your bug report.
>
> I cannot reproduce this using 3.2.1:
>
> % cat 8716.cc
> #include <string>
> using namespace std;
>
> int main( int, char** )
> {
> try
> {
> const char* s = NULL;
> string a = string( s, 0 );
> printf( "ok\n" );
> return 0;
> }
> catch( const exception& x ) { printf( "%s\n", x.what() ); return 1; }
> }
> % g++ 8716.cc
> % ./a.out
> ok
> %
>
> Can you try with the lastest release?
>
> I suspect that the fix for 8347 also changed this behavior.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8716
>
>
>