This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add target hook in C front end
> Where does this patch arrange for __SIZE_TYPE__ and __PTRDIFF_TYPE__ to be
> defined to the correct values in the preprocessor, for <stddef.h>?
In the backend that needs them. Look at the INIT_C_BUILTINS for where it
uses pushdecl and with the nodes that are created.
> It would be good to get this out of specs - but to do that, I think you
> need (a) no external cpp0, a special mode of cc1 being used instead, and
> (b) tradcpp as an integrated part of cc1 (or else say that if you use
> traditional preprocessing on C code some predefined macros may be missing
> and headers not work).
> We shouldn't do any MIPS-specific solution, or one specific to size_t and
> ptrdiff_t; we should do a general solution that means cc1/cc1plus can
> freely define preprocessor macros based on their state after processing
> the command line, so resolving other built-in types and such issues as
> __LONG_MAX__ and getting a correct <limits.h> in all cases.
I tried making this a vector in the target struct, unfortunately there
isn't a way to do this and still have languages other than C/C++ at the
moment. :) I tried to make this a non-MIPS specific solution, and just
adds a hook that enables this if you need it.
I'm open to suggestions on how to do this though. This was just the best
solution that could be seen. On the bright side I may have a spec file
that only uses about 250 lines to properly do this one thing for the
MIPS backend. I'm not positive though because it takes about 10 days to
test it every time I change something. ;)
Fridays are not "pants optional"