lkml.org 
[lkml]   [2015]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] kconfig: also warn of unhandled characters in statements
Date
While commit 2e0d737fc76f ("kconfig: don't silently ignore unhandled
characters") introduced a warning for unsupported characters inside
parameters, it does not cover situations where a statement
has additional characters around it.

This change introduces a warning if superfluous characters are found
around statements. As the 'help' statement sometimes is written as
'---help---', the '-' character would now also be regarded as
unhandled, this change also adds a special rule for this case.

Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
---
scripts/kconfig/zconf.l | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 200a3fe..84a5d05 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -106,7 +106,15 @@ n [A-Za-z0-9_]
zconflval.string = text;
return T_WORD;
}
- .
+ "---help---" {
+ /* Support old syntax for help statement */
+ return T_HELP;
+ }
+ . {
+ fprintf(stderr,
+ "%s:%d:warning: ignoring unsupported character '%c'\n",
+ zconf_curname(), zconf_lineno(), *yytext);
+ }
\n {
BEGIN(INITIAL);
current_file->lineno++;
@@ -132,7 +140,6 @@ n [A-Za-z0-9_]
BEGIN(STRING);
}
\n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
- --- /* ignore */
({n}|[-/.])+ {
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
--
1.9.1


\
 
 \ /
  Last update: 2015-07-03 15:21    [W:0.097 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site