]> sourceware.org Git - glibc.git/commitdiff
* stdlib/strtod_l.c (round_and_return): We have to set errno to
authorUlrich Drepper <drepper@redhat.com>
Sat, 25 Apr 2009 17:56:10 +0000 (17:56 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 25 Apr 2009 17:56:10 +0000 (17:56 +0000)
ERANGE for underflows.
* stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.

ChangeLog
stdlib/strtod_l.c
stdlib/tst-strtod.c

index 348d7f35aeb404561bfdefc16048ea2687dbf0d3..af38b11d1af60f7b9ca77becfdc21b27adfa2923 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-04-25  Ulrich Drepper  <drepper@redhat.com>
 
+       * stdlib/strtod_l.c (round_and_return): We have to set errno to
+       ERANGE for underflows.
+       * stdlib/tst-strtod.c (tests): Two tests should set errno to ERANGE.
+
        * stdio-common/stdio_lim.h.in (L_cuserid): Not part of POSIX since
        the 2001 revision.
 
index 09a8f9bb3b766cfaabe7c3878c3da824a46513ae..9ddfa3fa6635af51c59f4cd55f248e910a602a05 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string representing a number to float value, using given locale.
-   Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008
+   Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -232,6 +232,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
 # define DENORM_EXP (MIN_EXP - 2)
 #endif
       exponent = DENORM_EXP;
+      __set_errno (ERANGE);
     }
 
   if ((round_limb & (((mp_limb_t) 1) << round_bit)) != 0
index 628e40ca39f80fd62f4f4a45baeb0ddb942f0fec..c30eb1ee12bda188e903b94a363c02a232ee312e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,96,97,98,99,2000,2001,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996-2001,2003,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -61,10 +61,10 @@ static const struct ltest tests[] =
     { "0x00.0014p19", 160.0, '\0', 0 },
     { "0x1p-1023",
       1.11253692925360069154511635866620203210960799023116591527666e-308,
-      '\0', 0 },
+      '\0', ERANGE },
     { "0x0.8p-1022",
       1.11253692925360069154511635866620203210960799023116591527666e-308,
-      '\0', 0 },
+      '\0', ERANGE },
 #if __GNUC_PREREQ(2,96)
     /* For older GCC release HUGE_VAL is not a constant.  */
     { "Inf", HUGE_VAL, '\0', 0 },
This page took 0.059024 seconds and 5 git commands to generate.