[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ2nTa28zmMdpYZnNkLa5uFnq=4WeCinCrNa=3fcHenoA@mail.gmail.com>
Date: Fri, 30 Mar 2018 14:30:49 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Ulf Magnusson <ulfalizer@...il.com>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Sam Ravnborg <sam@...nborg.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Luis R . Rodriguez" <mcgrof@...nel.org>,
Nicolas Pitre <nico@...aro.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v2 04/21] kconfig: reference environments directly and
remove 'option env=' syntax
2018-03-29 11:19 GMT+09:00 Ulf Magnusson <ulfalizer@...il.com>:.
>> %%
>> +static void expand_string(const char *in)
>> +{
>> + char *p, *q;
>> +
>> + p = expand_string_value(in);
>> +
>> + q = p + strlen(p);
>> + while (q > p)
>> + unput(*--q);
>> +
>> + free(p);
>> +}
>> +
>
> I like the simplicity of this approach, but I suspect it might be too simple.
>
> For example, the following breaks with a syntax error if $ENV has any
> double quotes in its value:
>
> config FOO
> string "foo"
> default "$ENV"
>
> The following will only work as expected if $ENV expands to a valid
> Kconfig symbol name. If it doesn't, random stuff will happen (most
> likely a syntax error).
>
> config FOO
> string "foo"
> default $ENV
>
> The reason it works if $ENV expands to a valid symbol name is that
> undefined symbols get their name as their (string) value. If the
> symbol happens to be defined, it will be referenced, which seems
> confusing too.
>
> In general, that reinterpretation of expanded values feels a bit icky
> to me, and as something that might add complexity to Kconfig for
> little value. If $ENV outside of quotes absolutely must be supported,
> I think it should be a shorthand for "$ENV" (which means "constant
> value" in Kconfig speak).
>
You are right. This implementation is too lazy, and bad.
I will change the implementation.
Thanks.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists