NetBSD-Bugs archive

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

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



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

From: Alan Barrett <apb%cequrux.com@localhost>
To: "Simon J. Gerraty" <sjg%crufty.net@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost, 
netbsd-bugs%NetBSD.org@localhost
Subject: Re: toolchain/38315: make: ?= should resolve LHS
Date: Thu, 27 Mar 2008 20:27:30 +0200

 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