This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_classify_type and typeclass.h
"Joseph S. Myers" wrote:
>
> On Tue, 3 Jul 2001, Stan Shebs wrote:
>
> > this anymore. Worse, by poking around via Google, I found some
> > references to it being used *outside* GCC sources, and to top it all
> > off, its results are being compared to literal integers(!), so most
> > changes to typeclass.h will break that code.
>
> glibc includes a testcase for its usages (gnulib/tst-gcc.c) to detect such
> breakages. However, I don't think the __builtin_classify_type uses are
> actually necessary for <tgmath.h> to be correct on arguments that C99
> allows.
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.
One minimal way to deal with this would be add a __builtin_is_real_type,
because all the usages of __builtin_classify_type compare with 8, which
(at least for today :-) ) happens to be real_type_class. Just an idea
though, tgmath.h made my brain hurt after looking at it for awhile so
I don't really understand how it's supposed to work.
Stan