This is the mail archive of the gcc@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]

Re: __builtin_classify_type and typeclass.h


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


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