NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/47888: make(1) mishandles empty() inside loops

The following reply was made to PR bin/47888; it has been noted by GNATS.

From: David Laight <>
Subject: Re: bin/47888: make(1) mishandles empty() inside loops
Date: Fri, 7 Jun 2013 19:09:27 +0100

 On Wed, Jun 05, 2013 at 12:30:01AM +0000, wrote:
 > >Number:         47888
 > >Category:       bin
 > >Synopsis:       make(1) mishandles empty() inside loops
 > make does not expand empty() correctly inside loops. It seems to be
 > taking the value of the loop variable from before/outside the loop.
 The problem is the way that make substitutes loop variables.
 In the 'old' days it used to substitute the loop varaiable and then
 parse the text.  This generated all sorts of issues.
 I changed if to transform $(loop_var) into $(:U<loop_var_data>)
 so that the loop variable text still comes from a variable substitution.
 However, and noted, this doesn't detect empty() or defined().
 A better solution might be to put the loop variable value into the
 symbol table for 'pass 1' substitutions and only do the $(:U<text>)
 fudge for all extant loop variables when command lines are saved.
 This probably isn't that hard - or wouldn't be it it wasn't make!
 David Laight:

Home | Main Index | Thread Index | Old Index