bugmake - Bugs: bug #45191, Implicit argument forwarding...

 
 

bug #45191: Implicit argument forwarding limited by infinite recursion checker

Submitter:  Julio Guerra <julio>
Submitted:  Tue 26 May 2015 10:46:34 AM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.0 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 26 May 2015 10:46:34 AM UTC, original submission:  

Hi,

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(a)
list_(a)
$a
list(b)
list_(b) <- error detected
ok

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.

Regards,

Julio Guerra <julio>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by julio (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code