NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: standards/40695: C99 violation: Macro NAN in /usr/include/math.h in not constant.
The following reply was made to PR standards/40695; it has been noted by GNATS.
From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: standards/40695: C99 violation: Macro NAN in /usr/include/math.h
in not constant.
Date: Thu, 19 Feb 2009 23:10:44 +0100
--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
This should fix it (not tested yet), plus a warn reference for __nanf.
Martin
--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch
Index: math.h
===================================================================
RCS file: /cvsroot/src/include/math.h,v
retrieving revision 1.47
diff -c -u -r1.47 math.h
--- math.h 25 Apr 2008 21:20:57 -0000 1.47
+++ math.h 19 Feb 2009 22:09:41 -0000
@@ -87,8 +87,12 @@
/* 7.12#5 NAN: a quiet NaN, if supported */
#ifdef __HAVE_NANF
+#if __GNUC_PREREQ__(3,3)
+#define NAN __builtin_nanf("")
+#else
extern const union __float_u __nanf;
#define NAN __nanf.__val
+#endif
#endif /* __HAVE_NANF */
/* 7.12#6 number classification macros */
--AhhlLboLdkugWU4S--
Home |
Main Index |
Thread Index |
Old Index