bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ftoastr: link error on HP-UX


From: Paul Eggert
Subject: Re: ftoastr: link error on HP-UX
Date: Mon, 13 Jun 2011 09:50:32 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

Thanks for the bug report.  I pushed this:

 ChangeLog       |    8 ++++++++
 lib/ftoastr.c   |   14 ++++++++------
 modules/ftoastr |    1 +
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 19a3dff..571df81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-13  Paul Eggert  <address@hidden>
+
+       ftoastr: use strtof only if HAVE_STRTOF
+       This is needed on HP-UX 11.11 with GCC 4.24; see Bruno Haible's report
+       <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00154.html>.
+       * lib/ftoastr.c (STRTOF) [LENGTH == 1]: Use strtof only if HAVE_STRTOF.
+       * modules/ftoastr (configure.ac): Check for strtof.
+
 2011-06-13  Bruno Haible  <address@hidden>
 
        gnulib-tool: Addendum to 2011-06-08 commit.
diff --git a/lib/ftoastr.c b/lib/ftoastr.c
index ff3d87c..7c99ef0 100644
--- a/lib/ftoastr.c
+++ b/lib/ftoastr.c
@@ -40,14 +40,15 @@
 # define FLOAT_MIN LDBL_MIN
 # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND
 # define FTOASTR ldtoastr
-# define STRTOF strtold
+# if HAVE_C99_STRTOLD
+#  define STRTOF strtold
+# endif
 #elif LENGTH == 2
 # define FLOAT double
 # define FLOAT_DIG DBL_DIG
 # define FLOAT_MIN DBL_MIN
 # define FLOAT_PREC_BOUND _GL_DBL_PREC_BOUND
 # define FTOASTR dtoastr
-# define STRTOF strtod
 #else
 # define LENGTH 1
 # define FLOAT float
@@ -55,14 +56,15 @@
 # define FLOAT_MIN FLT_MIN
 # define FLOAT_PREC_BOUND _GL_FLT_PREC_BOUND
 # define FTOASTR ftoastr
-# define STRTOF strtof
+# if HAVE_STRTOF
+#  define STRTOF strtof
+# endif
 #endif
 
 /* On pre-C99 hosts, approximate strtof and strtold with strtod.  This
    may generate one or two extra digits, but that's better than not
-   working at all.  Assume that strtof works if strtold does.  */
-#if LENGTH != 2 && ! HAVE_C99_STRTOLD
-# undef STRTOF
+   working at all.  */
+#ifndef STRTOF
 # define STRTOF strtod
 #endif
 
diff --git a/modules/ftoastr b/modules/ftoastr
index 9010e94..b52ce26 100644
--- a/modules/ftoastr
+++ b/modules/ftoastr
@@ -10,6 +10,7 @@ Depends-on:
 intprops
 
 configure.ac:
+AC_CHECK_FUNCS_ONCE([strtof])
 AC_REQUIRE([gl_C99_STRTOLD])
 
 Makefile.am:
-- 
1.7.4.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]