summaryrefslogtreecommitdiff
path: root/util/kconfig
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-07-17 17:26:48 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-08-09 12:39:03 +0200
commitf534203f06bd253d43c2213b2806976bed31596e (patch)
treea943f86ac731b6795aaa1b6070e59d29e6475290 /util/kconfig
parenteb5f45ac6243a2b0b92e1012ebd927a8b043973f (diff)
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>
Diffstat (limited to 'util/kconfig')
-rw-r--r--util/kconfig/confdata.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c
index 235debf614..5804b29faa 100644
--- a/util/kconfig/confdata.c
+++ b/util/kconfig/confdata.c
@@ -358,6 +358,7 @@ load:
if (def == S_DEF_USER) {
sym = sym_find(line + strlen(CONFIG_));
if (!sym) {
+ conf_warning("trying to assign non-existent symbol %s", line + strlen(CONFIG_));
sym_add_change_count(1);
goto setsym;
}
@@ -402,6 +403,13 @@ setsym:
if (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;
}