NetBSD-Bugs archive

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

Re: bin/43821 (make: oldstanding bug with loop variables)



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

From: Aleksey Cheusov <cheusov%tut.by@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
dholland%NetBSD.org@localhost
Subject: Re: bin/43821 (make: oldstanding bug with loop variables)
Date: Wed, 01 Sep 2010 10:09:46 +0300

 > Whether it's a bug is debatable (getting "malformed conditional" is a bug
 > but that's a minor aspect of the issue) but this is deeply ingrained
 > behavior of loop variables and it's not readily changed or "fixed".
 From the documentation it is unclear that loop variables cannot be used
 in condition statements directly just like normal variables. So,
 formally speaking, it is definitely a bug. If it is really really
 impossible to fix it, then it should be documented ;-) As for your
 example code, of course I know about such a workaround. My original post
 contained mostly the same fragment. I also know when variables are
 expanded but loop variable expansion doesn't relate to this PR.
 
 http://mail-index.netbsd.org/tech-userlevel/2010/06/08/msg003690.html
 
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/make/make.1.diff?r1=1.174&r2=1.175&only_with_tag=MAIN&f=h
 
 > Try this example on for size:
 
 > .for i in 1 2 3
 > j=${i}       
 > .if !empty(j:M2)
 > res=passed ${j}
 > .endif  
 > .endfor
 
 >  all:
 >      @echo ${res}
 
 -- 
 Best regards, Aleksey Cheusov.
 


Home | Main Index | Thread Index | Old Index