From d2c98cdbc5a66a95fd4a1d68ff21c371d31288a4 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 18 Nov 2020 15:35:29 +0100 Subject: Silently ignoring unexpected characters in configuration When having a doxygen configuration file like: ``` QUIET=YES @INPUT = file @UNKNOWN = @UNKNOWN1 @UNKNOWN 1 @UNK # test ``` we get the warnings ``` warning: ignoring unsupported tag 'UNKNOWN' at line 3, file Doxyfile warning: ignoring unknown tag 'UNKNOWN1' at line 4, file Doxyfile warning: ignoring unknown tag 'UNKNOWN' at line 5, file Doxyfile warning: ignoring unknown tag '1' at line 5, file Doxyfile warning: ignoring unknown tag 'UNK' at line 6, file Doxyfile # Difference with default Doxyfile 1.9.0 (fa65bb38f81457d00f9c900bb57eb68bea59b1b4) QUIET = YES INPUT = file ``` especially the missing of a warning about the `@` in `@INPUT` can be a bit misleading (it might be that the user wanted to use `@INCLUDE` and and specified `@INPUT` It would be better to have a warning about a not handled character instead of just ignoring it. --- src/configimpl.l | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/configimpl.l b/src/configimpl.l index 4a4a144..b12b40d 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -972,8 +972,10 @@ static void readIncludeFile(const char *incName) } \n { g_yyLineNr++; BEGIN(Start); } \\[ \r\t]*\n { g_yyLineNr++; BEGIN(Start); } +. <*>\\[ \r\t]*\n { g_yyLineNr++; } -<*>. +<*>[ \t] +<*>. { config_warn("ignoring unknown character '%c' at line %d, file %s\n",yytext[0],g_yyLineNr,g_yyFileName.data()); } <*>\n { g_yyLineNr++ ; } %% -- cgit v0.12