From 7ba79cafa8e03af90dea0c4378e024d24a7d64b7 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 23 Mar 2018 03:37:49 +0100 Subject: Warn if user (.config) value is outside of 'range' Example warning: warning: user value 0x100 on the hex symbol HEX (defined at Kconfig:18) ignored due to being outside the active range ([0x13, 0x73]) -- falling back on defaults This is a Kconfiglib-exclusive warning. It might be tricky to implement in the C tools, due to weird two-phase handling of int/hex symbols. There is unfortunately no easy way to map the warning back to a .config line, as the active 'range' can't be known in general until the entire configuration has been read (consider 'range 0 10 if FOO' for example). Instead, the warning is generated when the symbol value is calculated. --- testsuite.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testsuite.py') diff --git a/testsuite.py b/testsuite.py index c66f42c..110e6ec 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1131,6 +1131,9 @@ g # User values and dependent ranges + # Avoid warnings for assigning values outside the active range + c.disable_warnings() + def verify_range(sym_name, low, high, default): """ Tests that the values in the range 'low'-'high' can be assigned, and @@ -1200,6 +1203,8 @@ g verify_value("INACTIVE_RANGE", "2") verify_value("ACTIVE_RANGE", "1") + c.enable_warnings() + print("Testing defconfig_filename") -- cgit v1.2.3