public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Fernando.Vega.Higuera@informatik.uni-erlangen.de
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/10800: Locale problems prevent streams from recognizing whitespaces
Date: Thu, 15 May 2003 13:06:00 -0000	[thread overview]
Message-ID: <20030515125841.1595.qmail@sources.redhat.com> (raw)


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


             reply	other threads:[~2003-05-15 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-15 13:06 Fernando.Vega.Higuera [this message]
2003-05-15 16:09 paolo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030515125841.1595.qmail@sources.redhat.com \
    --to=fernando.vega.higuera@informatik.uni-erlangen.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).