This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: V3 and Integrated CPP [was Re: V3 PATCH: Disable wide-character tests where necessary]
Neil Booth wrote:
> > 1. When using --save-temps, use cpp output routines to write the .i
> > file while passing the tokens directly to cc1.
> >
> > 2. Invoke cpp to generate the .i file, then do it again for
> > compilation as usual.
>
> Yes, either of these should be possible. 2 is of course the simplest.
With 2 the input files might be different the second time around. This
isn't an issue is it?
> > 3. Position tokens in the .i file such that they are at the correct
> > column numbers. This would be useful for other programs too.
>
> If I understand your meaning, this isn't possible - a macro can expand
> arbitrarily wide.
It's possible but makes prohibitively large files. (Though most of the
below is to get the right line numbers, the right columns are a
relatively small cost).
example.c:
#define DOUBLE(x) (2*(x))
i = DOUBLE (i);
example.i:
#line 2 "example.c"
i =
#line 1 "example.c"
(2*(
#line 2 "example.c"
i
#line 1 "example.c"
))
#line 2 "example.c"
;
enjoy,
-- Jamie