bin/164361: make handles "+=" incorrectly when the variable has zero length

Eitan Adler eadler at freebsd.org
Sun Jan 22 15:28:14 UTC 2012


---------- Forwarded message ----------
From: Jilles Tjoelker <jilles at stack.nl>
Date: Sun, Jan 22, 2012 at 8:24 AM
Subject: Re: bin/164361 quick question about make
To: Eitan Adler <lists at eitanadler.com>

On Sun, Jan 22, 2012 at 12:48:49AM -0500, Eitan Adler wrote:
> Is the behavior reported in bin/164361 actually a bug?
> http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html
> appears to have comment on +=
> The patch provided seems to fix the issue for me, but is it correct?

I cannot find mention of += in the POSIX specification for make, but
there is a proposal to add it at
http://austingroupbugs.net/view.php?id=330 .

This proposal appears to describe exactly what we do: if the variable
already exists, a space is inserted between the old and the new value,
even if the old value is null.

The same happens in gmake and bmake (with the example).

Because an extraneous space is unlikely to cause problems (sh treats two
unquoted spaces the same as a single unquoted space), it seems unwise to
change this.


-- 
Eitan Adler
Source & Ports committer
X11, Bugbusting teams


More information about the freebsd-bugs mailing list