Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755125AbbGCMrU (ORCPT ); Fri, 3 Jul 2015 08:47:20 -0400 Received: from faui40.informatik.uni-erlangen.de ([131.188.34.40]:51800 "EHLO faui40.informatik.uni-erlangen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755356AbbGCMq6 (ORCPT ); Fri, 3 Jul 2015 08:46:58 -0400 From: Andreas Ruprecht To: Ulf Magnusson Cc: Paul Bolle , Valentin Rothberg , rafael.j.wysocki@intel.com, , , hengelein Stefan , linux@dominikbrodowski.net, Michal Marek , Andreas Ruprecht Subject: [PATCH 1/2] kconfig: also warn of unhandled characters in statements Date: Fri, 3 Jul 2015 14:46:38 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1751 Lines: 53 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 Signed-off-by: Andreas Ruprecht --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/