[coreboot-gerrit] New patch to review for coreboot: Kconfig: Add KCONFIG_STRICT mode

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Sat Jul 18 02:29:52 CEST 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10977

-gerrit

commit 5161802f974c95a20ded682a9d9c984043ff7f52
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Fri Jul 17 17:26:48 2015 -0700

    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 at coreboot.org>
---
 util/kconfig/confdata.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c
index 235debf..5804b29 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;
 }
 



More information about the coreboot-gerrit mailing list