The isnan test suite verifies that isnan() is a macro, not only a function.
This test fails on OSF/1 5.1 with gcc:

depbase=`echo test-isnan.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; gcc -std=gnu99 
-DHAVE_CONFIG_H -I.  -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./..  
-I../gllib -I./../gllib  -Wall -mieee  -g -O2 -MT test-isnan.o -MD -MP -MF 
$depbase.Tpo -c -o test-isnan.o test-isnan.c && mv -f $depbase.Tpo $depbase.Po
test-isnan.c:26:3: error: #error missing declaration
*** Exit 1

Gary has reported this error also for Solaris.

This fixes it:


2010-12-19  Bruno Haible  <br...@clisp.org>

        isnan: Ensure it is a macro.
        * lib/math.in.h (isnan): Define as a macro if not already a macro.
        * doc/posix-functions/isnan.texi: Mention problem on IRIX, OSF/1,
        Solaris.

--- doc/posix-functions/isnan.texi.orig Mon Dec 20 03:27:15 2010
+++ doc/posix-functions/isnan.texi      Mon Dec 20 03:27:01 2010
@@ -12,6 +12,9 @@
 @code{isnan} was introduced with C99 and is thus commonly not present
 on pre-C99 systems.
 @item
+...@code{isnan} is not a macro on some platforms:
+IRIX 6.5, OSF/1 5.1 with gcc, Solaris 11 2010-11.
+...@item
 On IRIX 6.5 with @code{cc}, @code{isnan} does not recognize some NaNs.
 @item
 On NetBSD/i386 and glibc/ia64, @code{isnan} does not recognize some
--- lib/math.in.h.orig  Mon Dec 20 03:27:15 2010
+++ lib/math.in.h       Mon Dec 20 03:06:33 2010
@@ -680,6 +680,10 @@
     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
     gl_isnan_f (x))
 # endif
+/* Ensure isnan is a macro.  */
+# ifndef isnan
+#  define isnan isnan
+# endif
 #elif defined GNULIB_POSIXCHECK
 # if defined isnan
 _GL_WARN_REAL_FLOATING_DECL (isnan);

Reply via email to