bug-coreutils
[Top][All Lists]
Advanced

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

signbit glitch (coreutils 6.10, Solaris 8 sparc, GCC 4.2.2)


From: Paul Eggert
Subject: signbit glitch (coreutils 6.10, Solaris 8 sparc, GCC 4.2.2)
Date: Thu, 24 Jan 2008 13:38:07 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

I ran into the following minor glitch when compiling coreutils 6.10 on
Solaris 8 sparc with GCC 4.2.2:

vasnprintf.c: In function 'vasnprintf':
vasnprintf.c:2196: warning: implicit declaration of function 'signbit'

Here is a patch to the gnulib signbit module to work around this
problem:

2008-01-24  Paul Eggert  <address@hidden>

        * m4/signbit.m4 (gl_SIGNBIT): Check that signbit is a macro.
        This suppresses a warning when compiling coreutils 6.10 with
        GCC 4.2.2 on Solaris 8.  In that combination, math.h does not
        define signbit, but GCC implements it internally (there is no
        library function) and issues a warning.

diff --git a/m4/signbit.m4 b/m4/signbit.m4
index 689b929..42bb189 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -1,5 +1,5 @@
-# signbit.m4 serial 2
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# signbit.m4 serial 3
+dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,9 @@ AC_DEFUN([gl_SIGNBIT],
       AC_TRY_RUN([
 #include <math.h>
 #include <string.h>
+#ifndef signbit
+"error: signbit is not a macro"
+#endif
 float p0f = 0.0f;
 float m0f = -0.0f;
 double p0d = 0.0;




reply via email to

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