Doug Semler - 2017-07-18

What is the result of your preprocessed source (gcc -E)? After including the missing float.h (for DBL_MAX) and adding the parameter argv to the code above so that it's actually ANSI C:

dougs@NBDL2J56P12 MINGW64 /z/mingw64/fpclassify
$ /c/Program\ Files/mingw-w64/x86_64-7.1.0-win32-seh-rt_v5-rev0/mingw64/bin/gcc -O3 foo.c

dougs@NBDL2J56P12 MINGW64 /z/mingw64/fpclassify
$ ./a.exe
5.0          ---> normal
0.0          ---> zero
-0.0         ---> zero
1.0/0.0      ---> Inf
2.0*DBL_MAX  ---> Inf
0.0/0.0      ---> NaN
log(-1.0)    ---> NaN
d            ---> normal
d            ---> Inf
d            ---> NaN


dougs@NBDL2J56P12 MINGW64 /z/mingw64/fpclassify
$ /c/Program\ Files/mingw-w64/x86_64-7.1.0-win32-seh-rt_v5-rev0/mingw64/bin/gcc --version
gcc.exe (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 7.1.0
...