scripts: kconfig: Handle warnings generated during evaluation

Warnings generated during symbol evaluation were accidentally ignored,
due to checking for warnings before writing .config and autoconf.h
(which indirectly evaluates all symbols).

Move the warning checking code to after writing the configuration to
catch such warnings. kconfig.py still gets rerun if any
warnings-turned-errors show up.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2018-07-20 18:04:30 +02:00 committed by Anas Nashif
commit b3d165f3c2

View file

@ -58,6 +58,13 @@ def main():
kconf.load_config(config, replace=False)
# Write the merged configuration and the C header. This will evaluate all
# symbols, which might generate additional warnings, so do it before
# checking for warnings.
kconf.write_config(args.dotconfig)
kconf.write_autoconf(args.autoconf)
# Print warnings for symbols whose actual value doesn't match the assigned
# value
for sym in kconf.defined_syms:
@ -93,13 +100,6 @@ def main():
.format(warning, sys.argv[0]))
# Write the merged configuration
kconf.write_config(args.dotconfig)
# Write the C header
kconf.write_autoconf(args.autoconf)
# Message printed when a promptless symbol is assigned (and doesn't get the
# assigned value)
PROMPTLESS_HINT = """