This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: Implement _Pragma operator
> > > Firstly, the destringized string does not pass through stages 1 and 2
> > > of processing; i.e. trigraphs, UCNs and escaped newlines are not
> > > processed. We should not do this for preprocessed input either, but
> > > we have been doing. I added a new flag "from_stage3" to indicate not
> > > to do this, and we use this for _Pragma, command line directives, and
> > > preprocessed buffers.
> >
> > We shouldn't be processing comments either.
>
> Hmmm. We should for _Pragma since they're a stage 3 item. Command
> line directives is a toss-up since we can make our own rules up there,
> so say we do since we do at the moment for simplicity. Are you
> referring to preprocessed buffers? If so; it's a simple fix so I'll
> do that soon with a test.
Preprocessed buffers, definitely. It's not a huge issue, since /* or //
surviving into phase 6 will always be a syntax error, and you have to
play evil macro games to get them there. But we ought to get it
right.
I don't particularly care about _Pragma or command line options.
> > I had been under the impression that string constant concatenation was
> > legal inside _Pragma, but in fact it isn't. It might make sense as an
> > extension, though; thoughts? (If we do, we ought to apply it to #line
> > and #include too, for consistency.)
>
> No! <g> Please, let's keep it simple. At least until we move string
> concatenation into cpplib.
I wasn't asking for an implementation right this instant, just
comments on the feature.
zw