You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#line takes effect inside skipped groups and does not expand macros #734
simplecpp handles #line while the file is read (TokenList::readfile), before conditional inclusion and macros are processed. A #line in a skipped group therefore still changes the line numbers, and a #line whose operands are macros is ignored.
#if0#line 100
#endif__LINE__
gcc: 4. simplecpp: 101.
Inside a skipped group
Input
gcc
simplecpp
#if 0 / #line 100 / #endif / __LINE__
4
101
#ifdef X / #line 100 / #endif / __LINE__
4
101
#if 0 / #line 100 "x.c" / #endif / __FILE__
"c.c"
"x.c"
#if 0 / #line -5 / #endif / int x;
int x;
error: Invalid character in line directive: '-'. (all output is lost)
Operands are macros
The standard says the tokens after #line are macro-expanded when they don't match one of the two forms directly (C11 §6.10.4p5, C++
[cpp.line]).
Activity