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)
>Organization:
>Environment:
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 
amd64
Architecture: x86_64
Machine: amd64
>Description:

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

>How-To-Repeat:

   ------
LIST=abc def ghi

X=xyz
foo:
.for X in $(LIST)
        @echo '$$(X) is: $(X)'
        @echo '$$(X:Mxyz) is: $(X:Mxyz)'
.if empty(X:Mxyz)
        @echo '...which is empty'
.else
        @echo '...which is NOT empty'
.endif
        @echo
.endfor
   ------

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
"xyz".

>Fix:

dunno yet



Home | Main Index | Thread Index | Old Index