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: Eric Christopher <echristo at redhat dot com>
- Cc: <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:43:49 +0000 (GMT)
- Subject: Re: [PATCH] Add target hook in C front end
On 17 Dec 2001, Eric Christopher wrote:
> > (a) There is nothing MIPS-specific about the issue, a fix must be
> > architecture-independent, arranging that on all architectures that
> > __SIZE_TYPE__ agrees with the internal size_t without the fragility of
> > specs.
> Ok. My solution appears platform independent. I wanted to make it a
> function in the target struct, but the language specificness of the
> problem is not allowing this. I'm not sure what your objection is here.
We don't need anything new in the target struct. There is an existing
macro SIZE_TYPE that names the type; each port should define this to an
appropriate expression. Given that, all that's needed is for the
definition of __SIZE_TYPE__ used by headers to agree, for which a call to
cpp_define is an appropriate and minimal solution.
> > (b) It is well-established that __SIZE_TYPE__ is a macro, not a typedef,
> > expanding to the normal C name of the relevant type. This is, for
> > example, relied on in the format checking tests to determine the
> > corresponding signed type. Did your patch pass c99-scanf-1.c?
> It failed a few of the cases that I was in the middle of tracking down.
> I was looking first at the validity of the testcase and then to see what
> I had done that would possibly change the behavior (though i remember
> some not passing before my patch either :) Aldy's question raises a
> point though as well. Is it "well-established" or "standards defined"?
It is well-established for GCC-using code, both in and out of GCC.
Joseph S. Myers