[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/46750: make oddity expanding variables assigned to with +=
The following reply was made to PR toolchain/46750; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
Subject: Re: toolchain/46750: make oddity expanding variables assigned to
Date: Wed, 22 Aug 2012 07:10:37 +0000
On Mon, Jul 30, 2012 at 09:50:05AM +0000, Edgar Fu? wrote:
> > The problem is that it's doing this even if the old value is the empty
> > string, so you get a leading space.
> If we, for a moment, set aside how make internally handles lists (and
> talk only about list elements not containing whitespace), the question is
> what we expect "FOO=" to do.
> Either we expect it to set FOO to the empty list. Then, after "FOO+=foo",
> the value should be "foo".
> Or we expect it to set FOO to a list containing an empty value. Then,
> after "FOO+=foo", the value should indeed be " foo", but FOO: should
> return that empty value.
> > Relatedly, if you do
> Here, the question is whether we expect "FOO+=" to append an empty list
> to FOO (e.g. don't change it) or whether we expext it to append an empty
> value to the list.
> Probably that should be discussed on tech-toolchain and then made
The historic behavior of make has always been that variables hold
strings which are whitespace-separated lists of words. There are no
empty values. I don't think this needs discussion (nor can it be
changed without risking a lot of fallout and incompatibility...)
David A. Holland
Main Index |
Thread Index |