URL: <http://savannah.gnu.org/bugs/?45191>
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 _______________________________________________________ Details: 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, _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?45191> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make