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

 
 

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

Submitted by:  Julio Guerra <julio>
Submitted on:  Tue May 26 10:46:34 2015  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 4.0Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue May 26 10:46:34 2015, 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1