* Marc Balmer <[EMAIL PROTECTED]> [080210 12:06]:
> Jim Razmus wrote:
>> I'm trying to compile a program that uses NAN.  It includes math.h which
>> I'm told C99 says should define it.  I've grepped the entire source tree
>> and read up on man 3 math and man 3 isinf.  Still no joy.
>> Trying to compile the program yields "error: `NAN' undeclared (first use
>> in this function)".
>> Can anyone point me in the right direction?
>
> you can use the isnan(3) function to test for NaN.  Does that not work
> in your program?
>

The isnan test is not the issue.  The program actually sets a variable to
the value NAN.  It's those lines that gak the compiler.

The lines that fail are:

sp->t_req = NAN;
sp->t_resp = NAN;

and the error during compilation is:

gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include   -include config.h
-DVARNISH_STATE_DIR='"/usr/local/var/varnish"' -g -O2 -MT
varnishd-cache_center.o -MD -MP -MF .deps/varnishd-cache_center.Tpo -c
-o varnishd-cache_center.o `test -f 'cache_center.c' || echo
'./'`cache_center.c
cache_center.c: In function `cnt_done':
cache_center.c:212: error: `NAN' undeclared (first use in this function)
cache_center.c:212: error: (Each undeclared identifier is reported only
once
cache_center.c:212: error: for each function it appears in.)
*** Error code 1

Hope that helps clear up my question.

Jim

Reply via email to