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: Aleksey Cheusov <vle%gmx.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/43821: make: longstanding bug with loop variables
Date: Wed, 01 Sep 2010 23:16:30 +0300

 offlist.
 
 I don't try to push people to fix this issue.
 But I whould like to see this behaviour documented in one way or another.
 How about something like?
 
 .SS BUGS
 Due to ... loop variable cannot be used inside the loop in condition
 statements. Workaround is...
 
 As you understand what it's happening here maybe you can update man page?
 
 >  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.
 >  
 >  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.
 >  
 >  If that were done then all the . directives would work identically
 >  on loop variables.
 >  
 >      David
 >  
 >  -- 
 >  David Laight: david%l8s.co.uk@localhost
 >  
 
 
 -- 
 Best regards, Aleksey Cheusov.
 


Home | Main Index | Thread Index | Old Index