summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-11-18 14:35:29 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-11-18 14:35:29 (GMT)
commitd2c98cdbc5a66a95fd4a1d68ff21c371d31288a4 (patch)
tree952a1b5a8b4c22a5447795780d96b3bdb83dc2d5
parentfa65bb38f81457d00f9c900bb57eb68bea59b1b4 (diff)
downloadDoxygen-d2c98cdbc5a66a95fd4a1d68ff21c371d31288a4.zip
Doxygen-d2c98cdbc5a66a95fd4a1d68ff21c371d31288a4.tar.gz
Doxygen-d2c98cdbc5a66a95fd4a1d68ff21c371d31288a4.tar.bz2
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.
-rw-r--r--src/configimpl.l4
1 files changed, 3 insertions, 1 deletions
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)
}
<SkipComment>\n { g_yyLineNr++; BEGIN(Start); }
<SkipComment>\\[ \r\t]*\n { g_yyLineNr++; BEGIN(Start); }
+<SkipComment,SkipInvalid>.
<*>\\[ \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++ ; }
%%