This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
conflict between libstdc++ nan and c99/builtin nan functions
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-bugs at gcc dot gnu dot org, gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 28 Nov 2002 09:47:15 -0500 (EST)
- Subject: conflict between libstdc++ nan and c99/builtin nan functions
I'm getting this warning (several times) when building libstdc++-v3:
> libstdc++-v3/libmath/mathconf.h:84: warning: conflicting types for
> built-in function `nan'
mathconf.h contains:
> #ifndef NAN
> # define NAN (nan())
> double nan (void);
> #endif
The definition of libstdc++-v3's `nan' in libmath/nan.c is:
> double nan ()
> { return strtod ("nan", NULL); }
whereas the builtin is defined as:
> double nan (const char *);
Checking:
http://www.opengroup.org/onlinepubs/007904975/functions/nan.html it
appears that the builtin is correct.
My question is whether libstdc++-v3 needs to provide `nan' as an
exportable function or whether it just needs it internally. If it's
just internally, perhaps I can change the NAN macro to just call
__builtin_nan(""), otherwise I'll correct the definition in nan.c.
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu