Kconfig: Add KCONFIG_STRICT mode
This is basically a -Werror mode for Kconfig. When exporting KCONFIG_STRICT in the Makefile, warnings in Kconfig will produce errors instead. This will make it easier to spot unclean Kconfig files, settings and dependencies. Change-Id: I941af24c3ccb10b8b9ddc5c98327154749ebbbc6 Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: http://review.coreboot.org/10977 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
eb5f45ac62
commit
f534203f06
|
@ -358,6 +358,7 @@ load:
|
||||||
if (def == S_DEF_USER) {
|
if (def == S_DEF_USER) {
|
||||||
sym = sym_find(line + strlen(CONFIG_));
|
sym = sym_find(line + strlen(CONFIG_));
|
||||||
if (!sym) {
|
if (!sym) {
|
||||||
|
conf_warning("trying to assign non-existent symbol %s", line + strlen(CONFIG_));
|
||||||
sym_add_change_count(1);
|
sym_add_change_count(1);
|
||||||
goto setsym;
|
goto setsym;
|
||||||
}
|
}
|
||||||
|
@ -402,6 +403,13 @@ setsym:
|
||||||
|
|
||||||
if (modules_sym)
|
if (modules_sym)
|
||||||
sym_calc_value(modules_sym);
|
sym_calc_value(modules_sym);
|
||||||
|
|
||||||
|
name = getenv("KCONFIG_STRICT");
|
||||||
|
if (name && *name && conf_warnings) {
|
||||||
|
fprintf(stderr, "\nERROR: %d warnings encountered, and warnings are errors.\n\n", conf_warnings);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue