www.delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <80575AFA5F0DD31197CE00805F650D767B2169@wilber.adroit.com> |
From: | "Robinow, David" <drobinow AT dayton DOT adroit DOT com> |
To: | =?iso-8859-1?Q?=27Gwena=EBl_Durand=27?= |
<Gwenael DOT dot DOT Durand AT laposte DOT dot DOT net>, | |
cygwin AT cygwin DOT com | |
Subject: | RE: [c++ stl] std::string bug? |
Date: | Wed, 27 Feb 2002 10:25:01 -0500 |
MIME-Version: | 1.0 |
X-Mailer: | Internet Mail Service (5.5.2653.19) |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id g1RFTED22356 |
> From: Gwenaël Durand [mailto:Gwenael DOT dot DOT Durand AT laposte DOT dot 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 Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |