public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: snyder@fnal.gov
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/6414: g++ 3.1 tellg() regression within last week
Date: Mon, 22 Apr 2002 20:16:00 -0000	[thread overview]
Message-ID: <200204230310.g3N3A2r12805@karma.fnal.gov> (raw)


>Number:         6414
>Category:       libstdc++
>Synopsis:       g++ 3.1 tellg() regression within last week
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 22 20:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     scott snyder
>Release:        3.1 20020422 (prerelease)
>Organization:
>Environment:
System: Linux karma 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77
>Description:


After the input stream changes of the last week, tellg() no longer
works correctly.  It seems to be returning the raw file position,
not taking into account the buffering that libstdc++ does.

This seems to happen only if tellg() is called after a read.
If a seek intervenes between the read and the tellg(), then the
return from tellg() is as expected (consistent with the above, since
libstd++ won't have anything buffered at that point).

Here's the output i get from the example below:

$ g++ -o x x.cc
$ ./x
0
177
$ wc x.cc
     11      26     176 x.cc
$

I expect the second offset printed to be `1'.

This worked ok with the 3.1 branch as of about apr 15, so it looks
like this was introduced during the past week.

sss



>How-To-Repeat:

- x.cc -------------------------------------------------------------------
#include <iostream>
#include <fstream>

int main ()
{
  std::ifstream s ("x.cc");
  std::cout << s.tellg() << "\n";
  s.get ();
  std::cout << s.tellg() << "\n";
  return 0;
}
--------------------------------------------------------------------------


>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-04-23  3:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-22 20:16 snyder [this message]
2002-04-22 22:56 ljrittle
2002-04-23  5:32 jason
2002-04-23  6:06 Jason Merrill
2002-04-23 15:00 jason

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=200204230310.g3N3A2r12805@karma.fnal.gov \
    --to=snyder@fnal.gov \
    --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).