Skip to content

Commit 2f82585

Browse files
committed
Warning message in case of preprocesssor macro substitution
During the manual merge of issue #8645 the change of a rule has been missed resulting in incorrect and missing warnings: missing: ``` aa.cpp:9: warning: expected formal parameter after # in macro definition 'def7': 'a#' aa.h:7: warning: expected formal parameter after # in macro definition 'def7': 'a#' gasnetex.h:16: warning: expected formal parameter after # in macro definition 'Z1': '#' ``` Less correct warnings, due to incorrect rule we get: ``` gasnetex.h:3: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' ( != 1)' gasnetex.h:17: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' ( != 1)' gg.h:4: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' ! 1L || ( 1L && != 0 && != 1)' ``` instead of: ``` gasnetex.h:3: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' (# != 1)' gasnetex.h:17: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' ( # != 1)' gg.h:4: warning: preprocessing issue while doing constant expression evaluation: syntax error: input=' ! 1L || ( 1L && # != 0 && # != 1)' ```
1 parent 97dffa0 commit 2f82585

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pre.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ WSopt [ \t\r]*
14411441
<RemoveCPPComment>{CPPC}
14421442
<RemoveCPPComment>[^\x06\n]+
14431443
<RemoveCPPComment>.
1444-
<DefineText>"#" {
1444+
<DefineText>"#"/{IDSTART} {
14451445
outputChar(yyscanner,' ');
14461446
yyextra->quoteArg=TRUE;
14471447
yyextra->defLitText+=yytext;

0 commit comments

Comments
 (0)