[uClibc]problems with isinf()/isnan()

trevor t_list at vtnet.ca
Fri Apr 12 17:05:43 UTC 2002


hi everyone,

using uClibc-0.9.11 configured with:
	HAS_MMU = true
	HAS_FLOATING_POINT = true
	DO_C99_MATH = true
	HAS_LONG_LONG = true

i'm having trouble getting isinf() and isnan() to behave. while trying to 
compile xinetd i came across this little gem. to isolate the problem i 
created the following piece of code:

 1 #define _ISOC99_SOURCE
 2
 3 #include <stdio.h>
 4 #include <math.h>
 5
 6 int main( void )
 7 {
 8     float a=24.56;
 9
10     printf( "%f is %sa number\n", a, isnan(a)? "not " : "" );
11     printf( "%f is %sinfinite\n", a, isinf(a)? "" : "not " );
12     return 0;
13 }

when compiled, the code as above gives me:
cc    -c -o main.o main.c
cc -o main main.o -lm
main.o: In function `main':
main.o(.text+0x58): undefined reference to `__isinff'
collect2: ld returned 1 exit status
make: *** [main] Error 1

if i comment out line 1, compiling gives:
cc    -c -o main.o main.c
cc -o main main.o -lm
main.o: In function `main':
main.o(.text+0x1e): undefined reference to `isnan'
main.o(.text+0x61): undefined reference to `isinf'
collect2: ld returned 1 exit status
make: *** [main] Error 1

if i leave in line 1 and comment out line 11 i get:
cc    -c -o main.o main.c
cc -o main main.o -lm
$ ./main
24.559999 is a number

which i assume is fine. does anyone have any ideas? i searched through the 
mbox archives and didn't find anything that appeared to be relevant.

best regards,
	trevor
-- 
please remove the underscore if you want to email me



More information about the uClibc mailing list