This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_classify_type and typeclass.h
- To: Stan Shebs <shebs at apple dot com>
- Subject: Re: __builtin_classify_type and typeclass.h
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Wed, 4 Jul 2001 22:10:26 +0100 (BST)
- cc: <gcc at gcc dot gnu dot org>
On Wed, 4 Jul 2001, Stan Shebs wrote:
> After a little more digging, it looks like the tgmath.h usage is the only
> actual one outside GCC, and it was only added by Ulrich a few months ago,
> so there's not much of an installed-base issue. I reviewed the discussion
> that you started last summer, http://gcc.gnu.org/ml/gcc/2000-07/msg00950.html
> but it didn't sound like there was a consensus on what to do, and later
> Ulrich just went with the __builtin_classify_type approach.
Ulrich took the proof-of-concept code I provided - which didn't use
__builtin_classify_type - failed to show enough taste to consider it too
obscure even for glibc - and added his own obfuscation in the form of
__builtin_classify_type. The use of __builtin_classify_type isn't needed,
since __floating_type detects whether a type is floating or not and
__tgmath_real_type converts integer types to double while leaving floating
types alone. If you pass anything else, such as structure types, the
behavior is undefined anyway.
http://sources.redhat.com/ml/libc-alpha/2000-08/msg00014.html
(but in fact there were still several bugs in the other parts of
<tgmath.h>, which I didn't touch, that turned up when a testsuite was
written for it some time later.)
Of course you'll need to write the fixincludes support to fix the existing
installed base with <tgmath.h> using __builtin_classify_type.
--
Joseph S. Myers
jsm28@cam.ac.uk