diff options
| author | Pengpeng Hou <pengpeng@iscas.ac.cn> | 2026-06-11 14:00:00 +0800 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-06-18 11:46:32 -0700 |
| commit | 645323a7f4e55bb3abb0cb003b6b9dc715c8dc21 (patch) | |
| tree | 163591ebab1b8a33a6efaf00393e96c3d566bb62 /Documentation | |
| parent | 9a289cc425bf469642533e4afa01c90f08971d01 (diff) | |
| download | ath-645323a7f4e55bb3abb0cb003b6b9dc715c8dc21.tar.gz | |
kconfig: add optional warnings for changed input values
When reading .config input, Kconfig stores user-provided values first
and then resolves the final value after applying dependencies, ranges,
and other constraints.
If the final value differs from the user input, Kconfig already tracks
that state internally, but it does not provide a focused diagnostic to
show which explicit inputs were adjusted. This is particularly confusing
for requested values that get forced down by unmet dependencies or
clamped by ranges.
Add an opt-in diagnostic controlled by KCONFIG_WARN_CHANGED_INPUT. Emit
the warnings from conf_write() and conf_write_defconfig() after value
resolution. Print the diagnostic to stderr directly, not through the
normal message callback, so it remains visible when conf is run with -s,
such as from make -s.
Keep the diagnostic out of the conf_message() formatting buffer so long
warning lists are not truncated, and mark processed symbols as written
before the SYMBOL_WRITE check so duplicate menu nodes cannot emit
duplicate warnings.
Document the new environment variable and add tests for olddefconfig,
savedefconfig, and the silent-conf path.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Tested-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20260611060000.23858-1-pengpeng@iscas.ac.cn
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/kbuild/kconfig.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/kbuild/kconfig.rst b/Documentation/kbuild/kconfig.rst index d213c4f599a40..e35dd1d5f9d30 100644 --- a/Documentation/kbuild/kconfig.rst +++ b/Documentation/kbuild/kconfig.rst @@ -59,6 +59,11 @@ Environment variables for ``*config``: This environment variable makes Kconfig warn about all unrecognized symbols in the config input. +``KCONFIG_WARN_CHANGED_INPUT`` + If set to a non-blank value, Kconfig prints optional warnings for + user-provided values that change after Kconfig resolves dependencies + or applies other constraints such as ranges. + ``KCONFIG_WERROR`` If set, Kconfig treats warnings as errors. |
