public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: overseers@gcc.gnu.org
Subject: Bugzilla account request
Date: Sun, 07 Aug 2016 04:18:00 -0000	[thread overview]
Message-ID: <CAMMLpeSkG___SCB9-u2tEaXgW1at5jEgxgcHZGyOSCALK57qVQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Hello,

I believe I have found a bug in GCC, but I am unable to report it for
lack of a bugzilla account. I'm including below the text of the bug
report that I'd like to add. At minimum, this issue needs to be
discussed or documented.

Would you please create a GCC bugzilla account for me?

-Alex


istream::seekg should not reset eofbit if -std=c++98

According to N3168 [1], as recently as 2010 the C++ standards did not
permit istream::seekg to reset istream::eof. When the change to the
standard was approved, libstdc++ started using the new behavior, even
for programs compiled with -std=c++98. This caused the bioinformatics
program GERMLINE [2] to break. In PEDIndividualsExtractor.cpp [3] we
see:

void PEDIndividualsExtractor::loadInput()
{
    ...

    while (!stream.eof() )
    {
        getIndividuals();
        stream.seekg(numberOfMarkers*4 + 1,ios::cur);
    }

    ...
}

void PEDIndividualsExtractor::getIndividuals()
{
    string discard, ID, famID;
    stream >> famID >> ID >> discard >> discard >> discard >> discard;
    if(!stream.good()) return;

    ...
}

This code stopped working sometime between GCC 4.4.5 / libstdc++
6.0.13 and GCC 4.6.3 / libstdc++ 6.0.16. With the change to libstdc++,
stream.eof() is always false, so loadInput() goes into an infinite
loop. An simple test program is attached.

I realize that I could petition the GERMLINE authors to change the
loop condition (and I eventually will), but the fact that you can't
get the old behavior even with -std=c++98 is a bug in GCC.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3168.htm
[2] http://www.cs.columbia.edu/~gusev/germline/
[3] http://www.cs.columbia.edu/~gusev/germline/germline-1-5-1.tar.gz

[-- Attachment #2: seekg-test.tar.xz --]
[-- Type: application/x-xz, Size: 332 bytes --]

             reply	other threads:[~2016-08-07  4:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-07  4:18 Alex Henrie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-25  2:33 Joseph C. Sible
2022-05-25  8:48 ` Mark Wielaard
2022-03-23 13:42 han zheng
2022-03-23 14:21 ` Mark Wielaard
2014-09-01 11:50 fuz
2014-09-02 12:36 ` Ian Lance Taylor

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=CAMMLpeSkG___SCB9-u2tEaXgW1at5jEgxgcHZGyOSCALK57qVQ@mail.gmail.com \
    --to=alexhenrie24@gmail.com \
    --cc=overseers@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).