-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 4/12/2008 6:40 AM: | Thanks for the quick reply (yes, I owe you at least one ;-). | | These are from gcc, so I looked in gcc's own extend.texi | and saw that they are functions. Here are examples that compile: | | double d = __builtin_huge_val(); | double e = __builtin_nan("0x0");
Aha. Solaris 10 has a buggy math.h - it defines NAN and HUGE_VAL incorrectly (to the value of the builtin function address, and not the result of calling the function), which totally explains the compiler error message. Actually, __builtin_nan(NULL) and __builtin_nan("") should compile as well; __builtin_nan() maps to POSIX nan() (not yet provided by gnulib), which POSIX specifies behaves as: nan(NULL) => strtod("NAN",NULL) nan("") => strtod("NAN()",NULL) nan("0x0") => strtod("NAN(0x0)",NULL) Now that we know the problem, I'll try and start hacking together a math.in.h fix. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgAr3MACgkQ84KuGfSFAYBA2QCgoA+wyTQHtjhajKpZruHoMmGB nh0AoMuEXikqHg/snoB/nCd4i9KCQxwH =tVLu -----END PGP SIGNATURE-----