From f534203f06bd253d43c2213b2806976bed31596e Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 17 Jul 2015 17:26:48 -0700 Subject: 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 Reviewed-on: http://review.coreboot.org/10977 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Patrick Georgi --- util/kconfig/confdata.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util/kconfig/confdata.c') 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; } -- cgit v1.2.3