NetBSD-Bugs archive

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

Re: toolchain/38315: make: ?= should resolve LHS



On Thu, 27 Mar 2008, Simon J. Gerraty wrote:
> > I am not sure about calling VarFind twice.  
> The alternative? 

Instead of

    try VarFind
    if failed {
        look for '$' and expand if appropriate
        try VarFind again
    }

just do

   look for '$' and expand if appropriate
   try VarFind

> >What happens in this case:

I messed up the test case.  I think I meant this:

        DOLLAR = $$
        LBRACE = {
        RBRACE = }
        # This creates a variable whose name is 'V.${DOLLAR}'.
        V.$$${LBRACE}DOLLAR${RBRACE} = bar
        # This should set the variable whose name is 'V.$', not the
        # variable whose name is 'V.${DOLLAR}'.  If VarFind is called
        # before looking for '$' in the LHS then I think it will
        # incorrectly think "Nothing to do, because the variable whose
        # name is 'V.${DOLLAR}' is already set".
        V.${DOLLAR} ?= baz

        all:
                # I want this to print "baz", but I think it will print "bar"
                @echo V.$$$$= ${V.$$}

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index