This is the mail archive of the
mailing list for the Cygwin project.
RE: [c++ stl] std::string bug?
- From: "Robinow, David" <drobinow at dayton dot adroit dot com>
- To: 'GwenaŽl Durand' <Gwenael dot dot dot Durand at laposte dot dot dot net>, cygwin at cygwin dot com
- Date: Wed, 27 Feb 2002 10:25:01 -0500
- Subject: RE: [c++ stl] std::string bug?
> From: GwenaŽl Durand [mailto:Gwenael.dot.Durand@laposte.dot.net]
> Subject: [c++ stl] std::string bug?
> It seems that one constructor of the std::string class or the
> data() method
> doesn't work properly.
> string::data() and string::c_str() are supposed to be
> equivalent but don't always behave the same.
I don't believe data() and c_str() are supposed to be the same.
If I remember correctly, data() is not guaranteed to be null-terminated.
> have a look at the following code and its test.
> PS: I update cygwin this morning => 1.3.9
This is most likely irrelevant.
> gcc 2.95.3-5
This is interesting. Now we can try this compiler on a non-cygwin system.
I did and Irix 6.5 w g++ 2.95.3 gives the same result.
This is fixed (assuming it's a bug -- see above) in 3.0
g++ 2.95 has a number of bugs that have been fixed in version 3 and above.
I don't imagine they'll be fixed.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html