https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103130
Bug ID: 103130
Summary: comments are parsed differently with -fdirectives-only
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: m.olbrich at pengutronix dot de
Target Milestone: ---
$ gcc --version
gcc (Debian 11.2.0-10) 11.2.0
[...]
Source:
$ cat tst.c
/*\
* this is a comment
\*/
int main()
{
return 0;
}
Preprocessor works just fine:
$ gcc tst.c -E -o tst.i ; echo $?
0
And the preprocessor output looks correct.
But in the presence of -fdirectives-only (which icecream uses), it produces an
error:
$ gcc -fdirectives-only tst.c -E -o tst.i
tst.c:1:1: error: unterminated comment
1 | /*\
| ^
I'm not sure if '\*/' is valid to end the comment, but I don't think it should
only fail with -fdirectives-only.