This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error in <math.h> distributed with GCC 2.95.3


I've detected an error in a header file distributed with GCC 2.95.3. The
header file is <math.h>. The error is in the treatment of the __USE_ISOC99
macro. In two places, lines 118 and 354, the erroneous construct

#if __USE_ISOC99

is used where it should read

#ifdef __USE_ISOC99


The proper use of this macro is something like

#define __USE_ISOC99
#include <math.h>

while the erroneous construct would require something akin to

#define __USE_ISOC99__
#define __USE_ISOC99 defined(__USE_ISOC99__)
#include <math.h>

which, apart from being butt ugly, I'm not even sure would work.


Here is a `diff -up OLD NEW` of the correction:

--- math.h      Tue Jul 24 19:41:23 2001
+++ /usr/include/math.h Sun Jul 15 15:59:48 2001
@@ -115,7 +115,7 @@ extern int signgam;


 /* ISO C99 defines some generic macros which work on any data type.  */
-#if __USE_ISOC99
+#ifdef __USE_ISOC99

 /* Get the architecture specific values describing the floating-point
    evaluation.  The following symbols will get defined:
@@ -351,7 +351,7 @@ extern int matherr (struct exception *__
 #endif


-#if __USE_ISOC99
+#ifdef __USE_ISOC99
 /* ISO C99 defines some macros to compare number while taking care
    for unordered numbers.  Since many FPUs provide special
    instructions to support these operations and these tests are


This error was discovered in the gcc 2.95.3 tarball distributed with
Slackware 8.0 (.../slackware-8.0/slakware/d1/gcc.tgz).

--
Matthew Garrett (Tuel /usr/)
garrett@mama.indstate.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]