From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17239 invoked by alias); 19 Feb 2008 21:40:28 -0000 Received: (qmail 16758 invoked by uid 48); 19 Feb 2008 21:39:49 -0000 Date: Tue, 19 Feb 2008 21:40:00 -0000 From: "aurelien at aurel32 dot net" To: glibc-bugs@sources.redhat.com Message-ID: <20080219213949.5774.aurelien@aurel32.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/5774] New: some strtod() cases are wrong X-Bugzilla-Reason: CC 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: 2008-02/txt/msg00071.txt.bz2 Observe the following code: volta$ cat strtod-test.c #include #include int main(int argc, char **argv) { double d; char *endp; char *s = argv[1]; if (argc != 2) { printf("Usage: %s string\n", argv[0]); return 1; } d = strtod(s, &endp); printf("Got value %g, string tail %s\n", d, endp); return 0; } volta$ ./strtod-test 'Nan(anana)ana' Got value nan, string tail )ana According to ISO C99 7.20.1.3 para 3, the trailing ')' is also part of the expected form in the NAN(n-char-seq-opt). Therefore the result should be 'ana'. -- Summary: some strtod() cases are wrong Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: aurelien at aurel32 dot net CC: glibc-bugs at sources dot redhat dot com GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://sourceware.org/bugzilla/show_bug.cgi?id=5774 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.