Question to math.h
Reinhard
Posts: 489
Sorry if I have a new question
During the port of the NMEA Lib I get problems with __isnan( double) from math.h
so I tried to reduce the problem to this snippet
and get linker error :
\myC\propeller_chip\gcc\isnan>propeller-elf-gcc -mlmm -o isnan_test.elf isnan_test.c -lm
C:\DOKUME~1\Reinhard\LOKALE~1\Temp\cckHbArR.o: In function `_main':
(.text+0x2c): undefined reference to `___isnan'
collect2: ld returned 1 exit status
I have no problem to compile and link this snippet with dev-cpp
best Regards
Reinhard
During the port of the NMEA Lib I get problems with __isnan( double) from math.h
so I tried to reduce the problem to this snippet
#include <math.h> // math.h -> int __isnan(double); // propeller-elf-gcc -mlmm -o isnan_test.elf isnan_test.c -lm void main () { double x; if(__isnan(x)) { ; } }
and get linker error :
\myC\propeller_chip\gcc\isnan>propeller-elf-gcc -mlmm -o isnan_test.elf isnan_test.c -lm
C:\DOKUME~1\Reinhard\LOKALE~1\Temp\cckHbArR.o: In function `_main':
(.text+0x2c): undefined reference to `___isnan'
collect2: ld returned 1 exit status
I have no problem to compile and link this snippet with dev-cpp
best Regards
Reinhard
Comments
We're working on a fix. You can work around it for now by using GCC's __builtin_isnan() in place of __isnan() or isnan(), e.g. by adding after the include of math.h.
Eric