bugmake - Bugs: bug #1744, Recursive $(call ...) invocations...

 
 

bug #1744: Recursive $(call ...) invocations inherit arguments

Submitted by:  Paul D. Smith <psmith>
Submitted on:  Mon 18 Nov 2002 06:47:39 PM UTC  
 
Severity: 1 - WishItem Group: Enhancement
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.79.1Operating System: Any
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 22 Jan 2003 01:47:42 PM UTC, comment #5:

Fixed in CVS. See attached patch.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 20 Jan 2003 05:21:34 PM UTC, comment #4:

I also ran into that problem with version 3.79.1. This is an ugly bug because it prevents useful error checking as in

oneArg = $(if $2,$(error Only one argument allowed),$1)

when `oneArg' is called for instance in the map function from the documentation:

map = $(foreach a,$(2),$(call $(1),$(a)))

In that case $2 shines through and effectively prevents error checking.

Stefan Merten <smerten>
Mon 20 Jan 2003 05:14:33 PM UTC, comment #3:

Actually the report is correct--although perhaps it should be termed an enhancement request, I'm not sure. But, it's not user error.

It is reporting that if A is called with 3 arguments, and A invokes B with only 2 arguments, then B can see A's 3rd argument by accessing $3... this is true.

PS. please be careful when you hit the buttons: you only need to hit them ONCE. Even if it looks like nothing is happening, please do not hit the submit etc. buttons more than once; thus causes duplicate bugs and responses to be reported. Thanks!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 20 Jan 2003 04:58:35 PM UTC, comment #2:

This is not a bug, the parameters to the call function must be comma-separated ',' so you are getting the correct output at present.

You meant to be calling it as:
all:;@echo $(call FUNC2,one,two)

Note the all important comma to make "two" the second param

Jon-Paul Sullivan <j3p0uk>
Mon 20 Jan 2003 04:57:24 PM UTC, comment #1:

This is not a bug, the parameters to the call function must be comma-separated ',' so you are getting the correct output at present.

You meant to be calling it as:
all:;@echo $(call FUNC2,one,two)

Note the all important comma to make "two" the second param

Jon-Paul Sullivan <j3p0uk>
Mon 18 Nov 2002 06:47:39 PM UTC, original submission:

If you invoke a user function that takes fewer arguments from within a user function that takes more arguments, the internal function can "see" the arguments to the outer function.

FUNC = $1 $2
FUNC2 = $(call FUNC,$1)
all:;@echo $(call FUNC2,one two)

$ make
one two

This is surprising because FUNC was only invoked with one argument, so should only print "one".

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #251:  b1744.patch added by psmith (4KiB - application/octet-stream - recursive call argument hiding patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:03:23 AM UTCpsmithFixed Release4.0=>3.81
Wed 22 Jan 2003 01:47:42 PM UTCpsmithOpen/ClosedOpen=>(Error - Not Found)
  Fixed ReleaseNone=>(Error - Not Found)
Wed 22 Jan 2003 01:47:41 PM UTCpsmithStatusNone=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1