This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] new exec-charset testcase
Mark Mitchell <mark@codesourcery.com> writes:
> The lexer would just need to say "I've seen __asm__ and an opening
> parenthesis; no translation until I see the closing parenthesis or
> another opening parenthesis." I think it's just a counter.
Hm. That might be doable.
Some __attribute__ notations are in the same boat though, and ... are
you ever allowed to write extern "C" at block scope?
>>... Oh, bother, you're going to run smack into the mess where the
>>standard requires string constant concatenation, escape sequence
>>interpretation, and conversion to the execution character set, all to
>>occur at once.
>>
> You've now surpassed my knowledge of such things.
A simple example: given
const char x[] = "\12" "3";
const char y[] = { 012, '3', 0 };
it is required that strcmp(x, y) == 0.
Some ways to do it wrong include combining the 3 into the octal
escape; translating the 012 byte; not translating the 3 byte.
> Is it possible to just translate always, and untranslate in those few
> cases where you need to do so?
Nope, unfortunately, that has the same problem.
zw