This is the mail archive of the
mailing list for the GCC project.
Re: Patch for PR 14635 (regression: nan not in C90)
On Thu, 18 Mar 2004, Richard Henderson wrote:
> On Thu, Mar 18, 2004 at 07:55:39PM +0000, Joseph S. Myers wrote:
> > * builtins.def (nan, nanf, nanl, nans, nansf, nansl): Change to
> > DEF_GCC_BUILTIN.
> Why wouldn't you use DEF_C99_BUILTIN or some variant?
It is a feature for __builtin_nan(whatever) to expand to a constant
expression, so __builtin_nanf can be used to define NAN, but a bug for (a
function call) nan(whatever) to do so. It seems simpler to make the code
agree with the documentation (that only the __builtin_ forms are
available) than to make calls to nan() and __builtin_nan() act
differently. There's no intrinsic reason there shouldn't also be built-in
functions for ordinary nan() etc. (C99 for the functions in C99) as long
as they are distinguished from the __builtin_ versions, but this is meant
to be a simple bug fix that makes the code follow the documentation while
avoiding namespace problems.
Joseph S. Myers