This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add target hook in C front end
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: Eric Christopher <echristo at redhat dot com>, <gcc-patches at gcc dot gnu dot org>, <zack at codesourcery dot com>, <rth at redhat dot com>, <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 17 Dec 2001 20:37:56 +0000 (GMT)
- Subject: Re: [PATCH] Add target hook in C front end
On 17 Dec 2001, Aldy Hernandez wrote:
> >>>>> "Joseph" == Joseph S Myers <firstname.lastname@example.org> writes:
> > (b) It is well-established that __SIZE_TYPE__ is a macro, not a
> > typedef,
> but that's just because it's always been done that way. It doesn't
> mean we have to continue doing it that way, especially after having
> looked at the mips specs attrocity which IMHO are completely
> unreadable, let alone maintainable.
Doing something maintainable, that works as present with a __SIZE_TYPE__
macro, is essentially straightforward, given the removal of the separate
cpp0 executable. Just add some calls to cpp_define, and remove all the
attempts to define __SIZE_TYPE__ in all the specs. Note that GCC's
<stddef.h> explicitly defines __SIZE_TYPE__ to a default if it isn't
already defined; there is quite likely to be third party GCC-specific code
that does this as well, expecting it to be a macro.
(For some reason, there are __builtin_size_t (which is the internal
sizetype, not the external c_size_type_node) and __builtin_ptrdiff_t
typedefs, but I don't know what they're meant to be used for.)
> > example, relied on in the format checking tests to determine the
> > corresponding signed type. Did your patch pass c99-scanf-1.c?
> Assuming eric's patch does not pass c99-scanf-1.c, can't the tests be
> fixed to work without a dependency on explicit types (ie, not typedefs
> as eric's patch introduces)?
The problem is to determine the signed type corresponding to size_t, and
the unsigned type corresponding to ptrdiff_t, which are required for
certain C99 formats. I haven't got anything better than the current
kludges in gcc.dg/format/format.h.
Joseph S. Myers