NetBSD-Bugs archive

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

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

>Number:         47888
>Category:       bin
>Synopsis:       make(1) mishandles empty() inside loops
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 05 00:30:00 +0000 2013
>Originator:     David A. Holland
>Release:        NetBSD 6.99.19 (20130404)
System: NetBSD valkyrie 6.99.19 NetBSD 6.99.19 (VALKYRIE) #12: Thu Apr  4 
02:19:36 EDT 2013  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE 
Architecture: x86_64
Machine: amd64

make does not expand empty() correctly inside loops. It seems to be
taking the value of the loop variable from before/outside the loop.


LIST=abc def ghi

.for X in $(LIST)
        @echo '$$(X) is: $(X)'
        @echo '$$(X:Mxyz) is: $(X:Mxyz)'
.if empty(X:Mxyz)
        @echo '...which is empty'
        @echo '...which is NOT empty'

With the "X=xyz" line in place, it always prints "is NOT empty"; with
that commented out so X is empty prior to the loop initialization, it
always prints "is empty". This is true whether or not LIST contains


dunno yet

Home | Main Index | Thread Index | Old Index