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

Zack Weinberg zack@codesourcery.com
Fri Sep 24 04:58:00 GMT 2004


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



More information about the Gcc mailing list