On Wed, Aug 2, 2023 at 8:29 PM Yoann Congal <yoann.congal@xxxxxxxx> wrote: > > On 7/30/23 10:59, Masahiro Yamada wrote: > > On Sat, Jul 29, 2023 at 12:23 AM Yoann Congal <yoann.congal@xxxxxxxx> wrote: > >> Hi, > > Hi, > > >> While analyzing a Yocto bug[0] I think I've identified a problem in kconfig. > >> The problem happens if you have a hex or int type config without a default value. > >> Like this : > >> config TEST_KCONFIG > >> hex "Test kconfig" > >> # No default value > >> ... and try to start oldconfig with a closed stdin (like we have in Yocto): > >> echo -n "" | make oldconfig > >> > >> When this happens, oldconfig prompts for the value of TEST_KCONFIG but stdin is closed it get the global default value : an empty string. This is not a valid hex/int value so it prompts again, hence the infinite loop. > >> > >> I'm having trouble pointing where the bug is exactly : > >> * Should the global default value for hex/int be valid in their context? (like the minimal value of the range or 0/0x0) > >> * Must all int/hex config provide a valid default value? (This is the case for hex config in the kernel). This would have to be documented somewhere (Some other KConfig implementation did [1]) > > > > Presumably, it is reasonable to require explicit 'default' for int/hex. > > > > Most of the int/hex entries in Linux are already doing it. > > Shouldn't this be documented somewhere? (Sorry if it already is, I could not find it) I am more interested in showing a warning as not all people read the document. -- Best Regards Masahiro Yamada