kconfig: warn of unhandled characters in Kconfig commands
authorAndreas Ruprecht <andreas.ruprecht@fau.de>
Sun, 12 Jul 2015 07:41:50 +0000 (09:41 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Wed, 27 Apr 2016 14:10:03 +0000 (16:10 +0200)
commit51e70998a3af766f0a6366f7ee08d5fb19dae1dd
tree510b2a7b02c4cb28a4a11b30641d5bdbd196f0b9
parenta318d15e9291e956526fa23211706a4e471b84f4
kconfig: warn of unhandled characters in Kconfig commands

In Kconfig, definitions of options take the following form:
"<COMMAND> <PARAM> <PARAM> ...". COMMANDs and PARAMs are treated
slightly different by the underlying parser.

While commit 2e0d737fc76f ("kconfig: don't silently ignore unhandled
characters") introduced a warning for unsupported characters around
PARAMs, it does not cover situations where a COMMAND has additional
characters before it.

This change makes Kconfig emit a warning if superfluous characters
are found before COMMANDs. As the 'help' statement sometimes is
written as '---help---', the '-' character would now also be regarded
as unhandled and generate a warning. To avoid that, '-' is added to
the list of allowed characters, and the token '---help---' is included
in the zconf.gperf file.

Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Andreas Ruprecht <andreas.ruprecht@fau.de>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Tested-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/zconf.gperf
config/zconf.l