public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/10800: Locale problems prevent streams from recognizing whitespaces
@ 2003-05-15 13:06 Fernando.Vega.Higuera
  0 siblings, 0 replies; 2+ messages in thread
From: Fernando.Vega.Higuera @ 2003-05-15 13:06 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libstdc++/10800: Locale problems prevent streams from recognizing whitespaces
@ 2003-05-15 16:09 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2003-05-15 16:09 UTC (permalink / raw)
  To: Fernando.Vega.Higuera, gcc-bugs, gcc-prs, nobody

Synopsis: Locale problems prevent streams from recognizing whitespaces

State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Thu May 15 16:09:38 2003
State-Changed-Why:
    Duplicate of libstdc++/10441 and many others: you need a
    newer glibc (> 2.2.5). See:
    http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#3_8
    Thanks, Paolo.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10800


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-15 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-15 13:06 libstdc++/10800: Locale problems prevent streams from recognizing whitespaces Fernando.Vega.Higuera
2003-05-15 16:09 paolo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).