Re: [PATCH] kconfig: error out for recursive range
From: Nathan Chancellor
Date: Tue Aug 18 2026 - 15:04:34 EST
> Currently, it is possible to create recursive ranges with Kconfig, such as:
>
> config C
> int "Enable C"
> default 1
> range A B
>
> config A
> int "Enable A"
> default 2
> range B C
>
> config B
> int "Enable B"
> default 3
> range A C
>
> The current outcome of this example above, is that all 3 options are set to 2.
> There is currently no warning or error if a user attempts this.
>
> Several attributes are already checked for recursion, including 'depends on',
> 'select', and 'imply', and we can extend this to 'range' for numeric options
> (int and hex types).
>
> Recursive ranges are currently not used anywhere in the tree, so it is already
> safe to make this a hard error.
Thanks, this seems reasonable to me. The test passes in my environment
so it must be perfect, right? ;) I plan to pick this up for 7.4 once
7.3-rc1 is out.
--
Cheers,
Nathan