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

Bug#211661: gcc-3.3: With -std=c99, the NAN and INFINITY macros are not regarded as constants



Package: gcc-3.3
Version: 1:3.3.2-0pre3
Severity: normal

When compiling the following program with gcc -std=c99

#include <math.h>
int main (void)
{
  static double x = NAN;
  return x == 0;
}

I get:

testconstnan.c: In function `main':
testconstnan.c:27: error: initializer element is not constant

But the ISO C standard says (7.12):

       [#5] The macro

               NAN

       is defined if and only if the implementation supports  quiet
       NaNs   for  the  float  type.   It  expands  to  a  constant
       expression of type float representing a quiet NaN.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux greux.loria.fr 2.4.20 #2 Mon Mar 31 18:37:25 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=en_US.ISO8859-1

Versions of packages gcc-3.3 depends on:
ii  binutils                   2.14.90.0.6-1 The GNU assembler, linker and bina
ii  cpp-3.3                    1:3.3.2-0pre3 The GNU C preprocessor
ii  gcc-3.3-base               1:3.3.2-0pre3 The GNU Compiler Collection (base 
ii  libc6                      2.3.2-6       GNU C Library: Shared libraries an
ii  libgcc1                    1:3.3.2-0pre3 GCC support library

-- no debconf information



Reply to: