Received: by 10.213.65.68 with SMTP id h4csp2259870imn; Thu, 29 Mar 2018 22:34:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4//4U3s0O91gSgHq6ymXX8wuEVQaHRRrSGC/X2Rgb0jiF/0TpjK++88efQDkFn4LH7CYFWh X-Received: by 10.98.69.142 with SMTP id n14mr8728211pfi.42.1522388056627; Thu, 29 Mar 2018 22:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522388056; cv=none; d=google.com; s=arc-20160816; b=fHVjbUNwU+0QpiDeoM0AxXV1i1PQUo4zJnIUh6b9B6b1odRIm0ytyIEDtH7K7QF+Y+ M9EKMGnkqImL2NSsIUXtnnj5nVm/Z9i5FLa5cHQ2AOA3kRy3GMgzI9By0vtaYTTIwlwv JOA/bEgPTvbG1r9r0Yq2T8bg3SoFpgXdSs/8m7hFcdveKQl/FtfG2pGGH4ySutLRvd0w B5HqkHAf276XDM9e8z64Ku7iN+chJ4/ir/l2xcGZPZnrSjna/2dkQRgYjpU//40/pkej cyOTReuyMNc2rVabKNUN1fm0oQdGSVmB11s+qvlx+AAyjmLvG6Ape1qECOucKHJVCoqO EvGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=ymri/fHgp8mKtbJXGZdQg7QOppsaa+cCWkZ7CsPFayk=; b=PDKZT7edEiE/32yVNitJPb/pvJwVaovJzQhuWfC2RTHrFjBWuU4La9y1V7mRya8Phn dOwhXk37zXuGZAxDJNND6yj0l6SCKE0xDAjAszT5uuwKYbGBlxYj6K19rBFwCujcpk3B rWFg2qUZsnuvYWmvzWgqiZjo9UCYTyTOjs1l29Mil2seWexGWjHJMq6wXCtyYuTj8RBx lTPWNdFo8/gvx8fK0cN2jf1kRt2j98k1bN1gMJs/eqPov4Qc/Fyxw1AmnTP7wBOungqL iOVLnoUfQKT30FYkOYH6I3w7/G/X2U8Pf5IQlDu50MWU8mZ9Bbc9r9FKhaIxDQI7oGql o+JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NQ1LRZzY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x143si5087079pgx.157.2018.03.29.22.33.48; Thu, 29 Mar 2018 22:34:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NQ1LRZzY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129AbeC3Fb6 (ORCPT + 99 others); Fri, 30 Mar 2018 01:31:58 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:35660 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725AbeC3Fb4 (ORCPT ); Fri, 30 Mar 2018 01:31:56 -0400 Received: from mail-ua0-f175.google.com (mail-ua0-f175.google.com [209.85.217.175]) (authenticated) by conssluserg-01.nifty.com with ESMTP id w2U5VUCT030898; Fri, 30 Mar 2018 14:31:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com w2U5VUCT030898 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1522387891; bh=ymri/fHgp8mKtbJXGZdQg7QOppsaa+cCWkZ7CsPFayk=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=NQ1LRZzY9GnvMls1JNHWLmfMMb79vb/x+zVzBDWHT5HF6z+I88jsZclD/oTIvzS1P JOp4Ho+wEifDLYyUfPwekoxAlN4CibSqVB6K/KDrraV2F+CUhB/frI19XjOMs1MFTn bdBFn/nlezyQmlAdIlzUpJi9foSH/l0II2z/se0Ujd/ZN0komq6pAIQL8Bii9G3CmX /BsjURflWOky+/oiPFr9p7Y3c6G3fD2XA1kDhaeIEyrIouQMadGe+MLkAbM883fvh9 LUlu4/2Y/cSMS+JG6CO0cPEJgU4O+vUzmfqxyo8cyAgIujzUtcqb0OkZzUL6oLV1uG sMWJ9EIqUEwmA== X-Nifty-SrcIP: [209.85.217.175] Received: by mail-ua0-f175.google.com with SMTP id l21so4893922uak.1; Thu, 29 Mar 2018 22:31:30 -0700 (PDT) X-Gm-Message-State: AElRT7G9g1lunisQRcG+4OkOgup52VilNsJ+S8v00MfFkdtcGhtjXJRo f9fjig9OscRWAu76qxP7kI4+Ys0aawBv21oX6DA= X-Received: by 10.159.46.7 with SMTP id t7mr5874965uaj.199.1522387889867; Thu, 29 Mar 2018 22:31:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.29.150 with HTTP; Thu, 29 Mar 2018 22:30:49 -0700 (PDT) In-Reply-To: References: <1522128575-5326-1-git-send-email-yamada.masahiro@socionext.com> <1522128575-5326-5-git-send-email-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Fri, 30 Mar 2018 14:30:49 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 04/21] kconfig: reference environments directly and remove 'option env=' syntax To: Ulf Magnusson Cc: Linux Kbuild mailing list , Sam Ravnborg , Linus Torvalds , Arnd Bergmann , Kees Cook , Thomas Gleixner , Greg Kroah-Hartman , Randy Dunlap , "Luis R . Rodriguez" , Nicolas Pitre , Linux Kernel Mailing List , Ingo Molnar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-29 11:19 GMT+09:00 Ulf Magnusson :. >> %% >> +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