NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/43821: make: longstanding bug with loop variables
The following reply was made to PR bin/43821; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/43821: make: longstanding bug with loop variables
Date: Sat, 9 Oct 2010 21:03:41 +0000
On Wed, Sep 01, 2010 at 09:50:04AM +0000, David Laight wrote:
> The 'problem' is that the code that substitutes the loop variables
> into the loop body before the body is parsed (yes it does work that way)
> doesn't identify empty(...) as equivalent to $(...) and modify the text.
...which it can't without doing a full parse.
> Since empty() is just a comparison against "" there is a trivial
> work around.
>
> A better fix is to rework the .for handling (again) so that the loop
> control variables are put into the main symbol table for the first
> pass processing, and the textual substitution done when lines are saved.
> eg for variable assignments (except :=) and shell commands.
I think that's going to turn into a nightmare. I think the only
reasonable approach for this (and many other related problems) is to
tokenize and parse first before substituting anything, as I've
suggested before. Unfortunately, it's a huge undertaking.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index