From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15183 invoked by alias); 8 Feb 2012 10:40:13 -0000 Received: (qmail 15171 invoked by uid 22791); 8 Feb 2012 10:40:12 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Feb 2012 10:39:59 +0000 From: "tom at kera dot name" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/52169] the ifstream readsome() method does not signal any bit on eof. Date: Wed, 08 Feb 2012 10:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tom at kera dot name X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00829.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52169 Tomalak Geret'kal changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tom at kera dot name --- Comment #1 from Tomalak Geret'kal 2012-02-08 10:= 39:54 UTC --- cplusplus.com is (a) not authoritative, (b) full of mistakes, and (c) other= wise just awful. Instead, we'll quote the standard(s): [C++11: 27.7.2.3]: streamsize readsome(char_type* s, streamsize n); 32/ Effects: Behaves as an unformatted input function (as described in 27.7.2.3, paragraph 1). After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. Otherwise extra= cts characters and stores them into successive locations of an array whose first element is designated by s. If rdbuf()->in_avail() =3D=3D -1, calls setstate(eofbit) (which may throw ios_base::failure (27.5.5.4)), and extrac= ts no characters; =E2=80=94 If rdbuf()->in_avail() =3D=3D 0, extracts no characters =E2=80=94 If rdbuf()->in_avail() > 0, extracts min(rdbuf()->in_avail(),n)). 33/ Returns: The number of characters extracted. [C++03: 27.6.1.3]: streamsize readsome(char_type* s, streamsize n); 30/ Effects: Behaves as an unformatted input function (as described in 27.6.1.3, paragraph 1). After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. Otherwise extra= cts characters and stores them into successive locations of an array whose first element is designated by s. If rdbuf()->in_avail() =3D=3D -1, calls setstate(eofbit) (which may throw ios_base::failure (27.4.4.3)), and extrac= ts no characters; =E2=80=94 If rdbuf()->in_avail() =3D=3D 0, extracts no characters =E2=80=94 If rdbuf()->in_avail() > 0, extracts min(rdbuf()->in_avail(),n)). 31/ Returns: The number of characters extracted.