This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: change name `LONG_DOUBLE' to `LONGDOUBLE' in builtintypes


"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:

> Out convention in builtin-types.def and builtins.def is to name
> predeclared function signatures as BT_FN_<RETURN TYPE>_<ARGS...> So we
> get things like BT_FN_INT_LONG_FLOAT etc.
>
> I was trying to declare the signature for the C99 math functions
> lround and lrint, which is "long foo(double)" and works out to
> BT_FN_LONG_DOUBLE.  But this conflicts with "long double foo(void)"
> which resolves to the same BT_FN_LONG_DOUBLE and already exists in
> builtin-types.def.
>
> My solution is to remove the hyphen from the type "long double" and
> make it one word LONGDOUBLE, just like we do for "long long"
> represented as LONGLONG.  Then the type "long double" is
> distinguishable from the two types "long" and "double" in a signature
> sequence.  Then later I can proceed to add the missing functions.
>
> Bootstrapped on sparc-sun-solaris2.7 (minus java), testsuite underway.
> Assuming no regressions, Ok for mainline?

OK but please add a comment to builtin-types.def explaining why
LONGDOUBLE is used for the "long double" type.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]