Re: [PATCH] Documentation: warn against using int, hex, string options as expressions in Kconfig

Julian Braha <[email protected]>
Newsgroups org.kernel.vger.linux-doc,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 7/31/26 01:25, Nathan Chancellor wrote:
> Drop this quoting of y for clarity?

Sure, I'll send a v2.

>> This 'if FOO' will always be false, regardless of FOO's value (even when
>> FOO=1). The same goes for strings and hex.
> Hmmm, it might be kind of nice to either:
> 
> 1. Warn about this in Kconfig directly (if possible)
> 2. Support this usage in Kconfig how one would intuitively expect from
>    either C or Python where symbols with values of 0, 0x0, and '' would
>    be treated as false and every other value set as true.

Agreed, an interpreter change for this is on my roadmap. Though I was
also considering to make this error out.

Would be good to get some more feedback from others on which approach is
preferred (Jani, Arnd?)

> That said, until either of those potentially happen, this patch seems
> fine.

Thanks for your review!

- Julian Braha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.