Ulf Magnusson 2c37e08464 kconfig: Warn if choice default is not in choice
This will catch mistakes like in the following real-world example, where
a "CONFIG_" prefix snuck in, making an undefined symbol the default:

	choice
		prompt "Compiler optimization level"
		default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE

	config CC_OPTIMIZE_FOR_PERFORMANCE
		...

	config CC_OPTIMIZE_FOR_SIZE
		...

	endchoice

This now prints the following warning:

	init/Kconfig:1036:warning: choice default symbol 'CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE' is not contained in the choice

Cases where the default symbol belongs to the wrong choice are also
detected.

(The mistake is harmless here: Since the default symbol is not visible,
the choice falls back on using the first visible symbol as the default,
which is CC_OPTIMIZE_FOR_PERFORMANCE, as intended.)

Discovered while playing around with Kconfiglib
(https://github.com/ulfalizer/Kconfiglib).

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-07 23:45:51 +09:00
..
2017-08-19 11:02:53 -07:00
2015-10-20 19:13:14 +02:00
2016-11-16 09:26:33 +01:00
2005-04-16 15:20:36 -07:00
2017-08-19 11:02:53 -07:00
2017-08-19 11:02:53 -07:00
2015-10-14 14:59:03 +02:00
2015-02-25 15:00:16 +01:00
2017-08-19 11:02:53 -07:00