This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: conflict between libstdc++ nan and c99/builtin nan functions
> From: Gabriel Dos Reis <gdr@integrable-solutions.net>
>
> "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
>
> | 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
>
> Now that we have built-in NaNs (thanks rth!), this hackery should just
> go away.
>
> [...]
>
> | My question is whether libstdc++-v3 needs to provide `nan' as an
> | exportable function or whether it just needs it internally.
>
> It just used it internally (I can't recall for what exactly)
>
> | 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.
>
> Well, the NAN thingy should be removed.
Yes, checking further it appears the NAN macro was only used
internally in a bunch of files that were removed (by you) in Dec 2000.
http://gcc.gnu.org/ml/gcc-patches/2000-12/msg00434.html
And the nan function provided by libstdc++-v3 appears to only be there
to support the NAN macro. So I'll submit a patch to zap both after I
test it.
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu