[Top][All Lists]

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

[bug #45191] Implicit argument forwarding limited by infinite recursion

From: Julio Guerra
Subject: [bug #45191] Implicit argument forwarding limited by infinite recursion checker
Date: Tue, 26 May 2015 10:46:35 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36


                 Summary: Implicit argument forwarding limited by infinite
recursion checker
                 Project: make
            Submitted by: julio
            Submitted on: Tue 26 May 2015 10:46:34 AM GMT
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.0
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None




It seems the infinite recursion detector does not consider implicit argument
forwarding possible. When recursively expanding a variable without using
`call`, it is assumed it does not use $1, $2, etc. and is thus considered as
an infinite recursion.

list  = $(list_) # list_ called in the context of list, $1 of `list_` is the
$1 of `list`
list_ = $($1) # dummy example
a     = $(call list,b) # new "call scope" #2 with $1 = b
b     = ok
$(error $(call list,a)) # new "call scope" #1 with $1 = a
Result: *** Recursive variable 'list_' references itself (eventually).

The expansion is simple:
list_(b) <- error detected

The error disappears when forwarding arguments explicitly:
list  = $(call list_,$1)
list_ = $($1)
a     = $(call list,b)
b     = ok
$(error $(call list,a))
Result: ok

Implicit forwarding is very useful in some cases (e.g `arg1 = $(strip $1)`),
it would be nice to officially handle it.



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]