This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #pragma interface/implementation broken if --enable-mapped-location


Per Bothner <per@bothner.com> writes:

> The pragma line is saved as a string, not as tokens.  Then
> cp_lexer_handle_pragma calls cpp_handle_deferred_pragms which
> calls run_directive.  The pragma_token seen by do_pragma (the
> second time) is from lexing the run_directive string.

Maybe then we should change cpp_handle_deferred_pragma and
run_directive to take a source location.  This hasn't historically
been a problem with run_directive since it was used only for command
line switches.

Alternatively, I wanted originally to defer pragmas not by
encapsulating the un-tokenized line in a string, but by injecting a
keyword (__pragma) at the beginning of the line, a semicolon at the
end, and tokenizing normally (but with macro expansion disabled).
Matt persuaded me that was hard to implement, but maybe it should be
revisited.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]