I ran into this problem when compiling coreutils 6.10 on Solaris 8
(sparc) with GCC 4.2.2:

frexp.c: In function 'rpl_frexpl':
frexp.c:63: warning: implicit declaration of function 'isnanl'
vasnprintf.c: In function 'is_infinitel':
vasnprintf.c:252: warning: implicit declaration of function 'isnanl'

Here, the problem is that isnanl is defined by libm, but it's not
declared anywhere in /usr/include.

Here's a patch:

2008-01-24  Paul Eggert  <[EMAIL PROTECTED]>

        * m4/isnanl.m4: Check that isnanl is declared, when it's used.
        (gl_HAVE_ISNANL_NO_LIBM, gl_HAVE_ISNANL_IN_LIBM): Check that
        isnanl is declared, if we are not going to override it anyway.
        This suppresses a warning when compiling coreutils 6.10 with GCC
        4.2.2 on Solaris 8.  In that combination, no include file defines
        isnanl, but it's in libm, and GCC issues a warning when compiling.

diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index a02ded7..59a24e8 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -67,9 +67,12 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
                    #ifdef isnan
                    # undef isnanl
                    # define isnanl(x) isnan ((long double)(x))
+                  # define check_for_declaration 1
+                  #else
+                  # define check_for_declaration isnanl
                    #endif
                    long double x;],
-                  [return isnanl (x);],
+                  [return check_for_declaration && isnanl (x);],
         [gl_cv_func_isnanl_no_libm=yes],
         [gl_cv_func_isnanl_no_libm=no])
     ])
@@ -87,9 +90,12 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
                    #ifdef isnan
                    # undef isnanl
                    # define isnanl(x) isnan ((long double)(x))
+                  # define check_for_declaration 1
+                  #else
+                  # define check_for_declaration isnanl
                    #endif
                    long double x;],
-                  [return isnanl (x);],
+                  [return check_for_declaration && isnanl (x);],
         [gl_cv_func_isnanl_in_libm=yes],
         [gl_cv_func_isnanl_in_libm=no])
       LIBS="$save_LIBS"


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to