linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Andreas Ruprecht <andreas.ruprecht@fau.de>,
	Ulf Magnusson <ulfalizer.lkml@gmail.com>
Cc: Valentin Rothberg <valentinrothberg@gmail.com>,
	rafael.j.wysocki@intel.com, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	hengelein Stefan <stefan.hengelein@fau.de>,
	linux@dominikbrodowski.net, Michal Marek <mmarek@suse.cz>
Subject: Re: [PATCH 1/2] kconfig: also warn of unhandled characters in statements
Date: Sat, 04 Jul 2015 11:33:53 +0200	[thread overview]
Message-ID: <1436002433.20057.49.camel@tiscali.nl> (raw)
In-Reply-To: <a2424e6c57a4d6c38369c393ba58e0d050b7c130.1435927467.git.andreas.ruprecht@fau.de>

On vr, 2015-07-03 at 14:46 +0200, Andreas Ruprecht wrote:
> While commit 2e0d737fc76f ("kconfig: don't silently ignore unhandled
> characters") introduced a warning for unsupported characters inside
> parameters,

What are "parameters"? The term doesn't show up in Documentation/kbuild.

There's TF_PARAM in zconf.gperf, but that's some odd category that
apparently only includes "on" and "if". zconf.l only has the
undocumented PARAM state.

> 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.

         [...], but '-' characters will now also generate a warning,
  add a special rule for that case.

or something along those lines.

Should we elaborate here that currently "---help---" only is an alias
for "help" because we simply skip "---" when parsing Kconfig files? Or
is that trick so obscure that nobody else will care about it?

> 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 */

s/old/alternative/?

> +		return T_HELP;
> +	}
> +	.	{
> +		fprintf(stderr,
> +		        "%s:%d:warning: ignoring unsupported character '%c'\n",
> +		        zconf_curname(), zconf_lineno(), *yytext);
> +	}

Could you add and use a small helper function for this warning and the
identical warning that was added in commit 2e0d737fc76f?

>  	\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) {

Thanks,


Paul Bolle

  reply	other threads:[~2015-07-05 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 12:46 [PATCH 0/2] kconfig: warn of unhandled characters in statements Andreas Ruprecht
2015-07-03 12:46 ` [PATCH 1/2] kconfig: also " Andreas Ruprecht
2015-07-04  9:33   ` Paul Bolle [this message]
2015-07-05  6:44     ` Ulf Magnusson
2015-07-05  6:06   ` Ulf Magnusson
     [not found]     ` <559BA09A.2030603@fau.de>
     [not found]       ` <20150707144559.GA12760@huvuddator>
2015-07-08 10:17         ` Andreas Ruprecht
2015-07-08 20:18           ` Ulf Magnusson
2015-07-03 12:46 ` [PATCH 2/2] kconfig: Regenerate shipped zconf.lex.c file Andreas Ruprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436002433.20057.49.camel@tiscali.nl \
    --to=pebolle@tiscali.nl \
    --cc=andreas.ruprecht@fau.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mmarek@suse.cz \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stefan.hengelein@fau.de \
    --cc=ulfalizer.lkml@gmail.com \
    --cc=valentinrothberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).