The problem is that the definition of isfinite() macro is not consistent
between version of GCC 4.3.3 and 4.4.1.

Simple test program:

include <math.h>
#ifdef isfinite
#error isfinite defined
#else
#error isfinite NOT defined
#endif
int main() { return 0; }


1) Test with GCC 4.4.1 (Ubuntu 9.10 x86-64)

mlos...@dog:~/tmp$ gcc --version
gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1

mlos...@dog:~/tmp$ gcc isfinite.c
isfinite.c:3:2: error: #error isfinite defined
mlos...@dog:~/tmp$ 



2) Test with GCC 4.3.3  (Ubuntu 9.04 x86-32)

mlos...@vb-ubuntu904:~/tmp$ gcc --version
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3

mlos...@vb-ubuntu904:~/tmp$ gcc isfinite.c 
isfinite.c:5:2: error: #error isfinite NOT defined


In the 2nd case, it seems to be required to use compiler option -std=c99 to
enable the macro:

mlos...@vb-ubuntu904:~/tmp$ gcc -std=c99 isfinite.c 
isfinite.c:3:2: error: #error isfinite defined


I think the behaviour of version 4.3.3. is incorrect.

I didn't find any related reports, except the one for C++ use of iostream.h
together with math.h (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14608).
But I am sure it is not related to this report.


-- 
           Summary: isfinite macro defined for 4.4.1 but not for 4.3.3
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mateusz at loskot dot net
  GCC host triplet: x86_64-*-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42867

Reply via email to