public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gzljg at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/49506] New: reusing a file stream object will always get eof after openning
Date: Wed, 22 Jun 2011 20:31:00 -0000	[thread overview]
Message-ID: <bug-49506-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49506

           Summary: reusing a file stream object will always get eof after
                    openning
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gzljg@hotmail.com


Created attachment 24581
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24581
test programe to reproduce the file stream open-eof bug

It seems that if I reuse a std::ifstream object by "open(another_file)" it will
always return EOF right away. See the attached file for details.

I had confirmed this can be reproduced with gcc 3.3.3 but NOT in gcc 4.3.3.
(Not sure which exact version fixed the problem -- I had searched the similar
bug description but could not find one ).

In a good case, the test program should return 0 silently.
In a bad case, the test program print out "eof" and some of the bits of the
stream state and return 1;


             reply	other threads:[~2011-06-22 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 20:31 gzljg at hotmail dot com [this message]
2011-06-22 20:42 ` [Bug libstdc++/49506] " pinskia at gcc dot gnu.org
2011-06-26 15:37 ` redi at gcc dot gnu.org

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=bug-49506-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).