public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: johnb@stl.sarov.ru To: gcc-gnats@gcc.gnu.org Subject: libstdc++/7220: g++ 3.1: basic_istream::ignore(0,delimiter) issue. Date: Sat, 06 Jul 2002 07:06:00 -0000 [thread overview] Message-ID: <20020706140330.7450.qmail@sources.redhat.com> (raw) >Number: 7220 >Category: libstdc++ >Synopsis: g++ 3.1: basic_istream::ignore(0,delimiter) issue. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Jul 06 07:06:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: johnb@stl.sarov.ru >Release: g++ 3.1 >Organization: >Environment: Red Hat Linux release 7.2, g++ v3.1 >Description: basic_istream::ignore(0,delimiter) extracts delimiter if it (delimiter) is at stream read position without regard to first parameter == 0. In case delimiter isn`t at read position ignore(0,delimiter) do nothing and this is correct. C++ ISO|IEC 27.6.1.3-24 declare that ignore(n,...) should extract n symbols in case n != numeric_limits<int>::max(). This condition is true for n = 0; See testcase attached. >How-To-Repeat: Compile testcase with g++ 3.1 and run it. You`ll see some "failed" messages. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="ignore.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ignore.cpp" I2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCiNkZWZpbmUgSXMJc3RkOjpi YXNpY19pc3RyZWFtPGNoYXIsc3RkOjpjaGFyX3RyYWl0czxjaGFyPiA+CiNkZWZpbmUgSXQJc3Rk OjpjaGFyX3RyYWl0czxjaGFyPgojZGVmaW5lIEFsCXN0ZDo6YWxsb2NhdG9yPGNoYXI+CgppbnQg bWFpbihpbnQsIGNoYXIgKltdKQp7CglpbnQgcmVzID0gMDsKICAgICAgICBzdGQ6OnN0cmVhbXNp emUgbjsKCXN0ZDo6YmFzaWNfc3RyaW5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GUpaXN0ci5wZWVrKCkgPDwgIiBpbnN0ZWFkIG9m ICdiJ1xuIjsKCiByZXR1cm4gMDsKfQo=
next reply other threads:[~2002-07-06 14:06 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-06 7:06 johnb [this message] 2002-07-25 16:24 bkoz 2002-07-27 14:57 bkoz
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=20020706140330.7450.qmail@sources.redhat.com \ --to=johnb@stl.sarov.ru \ --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: linkBe 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).