This is the mail archive of the gcc-bugs@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]

[Bug c++/13258] strings used for the extern keyword are being translated by the -fexec-charset option


------- Additional Comments From darcypj at us dot ibm dot com  2003-12-01 18:46 -------
(In reply to comment #2)

The idea I was toying with was to have the lexer not translate strings that fall
into one of these contexts?  

For example, when the keyword 'extern' is found, then perhaps set a flag such
that if the next token is a character literal cpp_interpret_string_notranslate()
is called rather than cpp_interpret_string for the upcoming literal?  (If a flag
were used, I would assume that it would be static and that
cpp_interpret_string_notranslate() would reset it.)

I did see a token lookahead capability in cpplex.c which gives me the idea that,
instead of a flag, when we hit the extern keyword, we can check the next token
to see if it is a string literal that we can tell the compiler to treat as it
would an octal or hex formatted literal and not translate it.

It would take me some more time to poke around in the code if I am to come up
with a coding of this, if it is even possible, but the basic idea is that this
needs to be done at the lexer because that is where you call the translation
functions.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13258


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