| 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 |
| From: | "Brian Bull" <b DOT bull AT niwa DOT cri DOT nz> |
| To: | cygwin AT cygwin DOT com |
| Date: | Fri, 11 Jan 2002 17:16:17 +1300 |
| MIME-Version: | 1.0 |
| Subject: | funny strstream bug (yes I know it's deprecated) |
| Message-ID: | <3C3F1DE1.27170.AB0B7BB@localhost> |
| X-mailer: | Pegasus Mail for Win32 (v3.12c) |
People probably don't care about strstream any more but I still
thought this was an interesting one.
Self contained bug example follows:
---------------------------------------
#include <string>
#include <strstream>
int main(){
std::string fred = "
some_spaces_precede_a_single_exceedingly_long_word 1 ";
istrstream arguments((fred+" ").c_str());
std::string base;
arguments >> base;
int L;
arguments >> L;
cerr << "L " << L << '\n';
}
// Expected output: L 1
// Actual output on my system: L 0 (??!!)
----------------------------------------
Puzzlingly, the code can be made to work by replacing the words
'exceedingly long' by 'short' in std::string fred.
I'm running today's download of Cygwin and gcc on Win2000.
Any enlightenment welcome.
Yours
Brian Bull
--
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 |