From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26458 invoked by alias); 25 Jan 2011 20:01:51 -0000 Received: (qmail 26406 invoked by uid 22791); 25 Jan 2011 20:01:50 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,GARBLED_SUBJECT,SARE_HEAD_8BIT_SPAM,SARE_SUB_ENC_UTF8 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Jan 2011 20:01:44 +0000 From: "hjl.tools at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12437] New: scanf behavior differs from WG14/=?UTF-8?Q?N1256=20Committee=20Draft=20=E2=80=94=20Septermber=207?=, 2007 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Tue, 25 Jan 2011 20:46:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00087.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D12437 Summary: scanf behavior differs from WG14/N1256 Committee Draft =E2=80=94 Septermber 7, 2007 Product: glibc Version: 2.13 Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: drepper.fsp@gmail.com ReportedBy: hjl.tools@gmail.com Page 300 in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf says "100e" shouldn't match "%f". But I got [hjl@gnu-6 tmp]$ cat s.c #include int main() { int count; float quant; char buf[100]; count =3D fscanf(stdin, "%f%s", &quant, buf); printf ("quant =3D %lf\n",quant ); printf ("count =3D %d\n", count); printf ("string =3D %s\n", buf); return 0; } [hjl@gnu-6 tmp]$ gcc s.c [hjl@gnu-6 tmp]$ cat x.input=20 100ergs of energy [hjl@gnu-6 tmp]$ ./a.out < x.input=20 quant =3D 100.000000 count =3D 2 string =3D rgs [hjl@gnu-6 tmp]$=20 I was told that Windows and MacOS behave the same as glibc. --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.