Running translate-c on the following code causes an assertion failure:
in transPreprocessorEntities, assert(mem.eql(u8, macro_ctx.slice(), name)); is failing because name is __$foo but macro_ctx.slice() returns __, presumably because $ is an invalid token.
Technically that is correct, but GCC allows it for legacy reasons: http://gcc.gnu.org/onlinedocs/cpp/Tokenization.html#Tokenization
As an extension, GCC treats ‘$’ as a letter. This is for compatibility with some systems, such as VMS, where ‘$’ is commonly used in system-defined function and object names. ‘$’ is not a letter in strictly conforming mode, or if you specify the -$ option.
What should translate-c do here? Fail with a better error message, or translate it as @"__$foo"?
Running translate-c on the following code causes an assertion failure:
in
transPreprocessorEntities,assert(mem.eql(u8, macro_ctx.slice(), name));is failing becausenameis__$foobutmacro_ctx.slice()returns__, presumably because$is an invalid token.Technically that is correct, but GCC allows it for legacy reasons: http://gcc.gnu.org/onlinedocs/cpp/Tokenization.html#Tokenization
What should translate-c do here? Fail with a better error message, or translate it as
@"__$foo"?