From 7a26be70f5c2a4e1454807e13267bacef380883d Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 20 Jan 2021 18:52:20 +0100 Subject: Incorrect line count for normal comment in define When having the program: ``` /// \file #define A_DEF 2 /* A line * A line */ /** * the wrong line \line7 */ void fie(void) {} `` we get the message: ``` aa.c:6: warning: Found unknown command '\line7' ``` instead of ``` aa.c:7: warning: Found unknown command '\line7' ``` Also in the source code and the reference to it we see a wrong line number for the function `fie`. --- src/pre.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pre.l b/src/pre.l index 4a86562..cdb9533 100644 --- a/src/pre.l +++ b/src/pre.l @@ -1351,6 +1351,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) yyextra->yyLineNr++; yyextra->defLitText+=yytext; yyextra->defText+=' '; + outputChar(yyscanner,'\n'); } "*/"{B}*"#" { // see bug 594021 for a usecase for this rule if (yyextra->lastCContext==SkipCPPBlock) -- cgit v0.12