Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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" To: =?iso-8859-1?Q?=27Gwena=EBl_Durand=27?= , 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) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit 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/