From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18873 invoked by alias); 15 May 2003 13:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 18763 invoked by uid 71); 15 May 2003 13:06:01 -0000 Resent-Date: 15 May 2003 13:06:01 -0000 Resent-Message-ID: <20030515130601.18762.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Fernando.Vega.Higuera@informatik.uni-erlangen.de Received: (qmail 1601 invoked by uid 48); 15 May 2003 12:58:41 -0000 Message-Id: <20030515125841.1595.qmail@sources.redhat.com> Date: Thu, 15 May 2003 13:06:00 -0000 From: Fernando.Vega.Higuera@informatik.uni-erlangen.de Reply-To: Fernando.Vega.Higuera@informatik.uni-erlangen.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/10800: Locale problems prevent streams from recognizing whitespaces X-SW-Source: 2003-05/txt/msg01786.txt.bz2 List-Id: >Number: 10800 >Category: libstdc++ >Synopsis: Locale problems prevent streams from recognizing whitespaces >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu May 15 13:06:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Fernando Vega Higuera >Release: gcc version 3.2.2 / gcc version 3.3 20030512 (prerelease) >Organization: >Environment: P4 - 1GB RAM Linux Suse 7.2 Linux 2.4.4-4GB >Description: The following code recognizes whitespaces when using gcc 3.0. The reported versions of gcc don't recognize whitespaces. This behavior prevents streams from reading strings word by word. Thereby, the whole data gets readed if a string is retrieved from the stream.(eg. cin >> myString;) bool ParseFile(const char* fileName) { if( !fileName ) return false; ifstream inFile( fileName ); if( !inFile ) return false; inFile >> noskipws; char aChar; while( !inFile.eof() ) { inFile >> aChar; cout << aChar << "["; if( isspace( aChar, inFile.getloc() ) ) cout << " true ]" << endl; else cout << " false ]" << endl; } inFile.close(); return true; } >How-To-Repeat: The main program is this one: int main(int argc, char* argv[]) { cout << "Result: " << ParseFile( argv[1] ) << "." << endl; return 0; } Compile with: g++ -ggdb -o runMe main.cpp Run with: runMe [your_text_file] >Fix: None that i know. >Release-Note: >Audit-Trail: >Unformatted: