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

 
 

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

Submitter:  Paul D. Smith <psmith>
Submitted:  Mon 18 Nov 2002 06:47:39 PM UTC
   
 
Severity:  1 - Wish Item Group:  Enhancement
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.79.1 Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 08 Feb 2003 11:34:15 AM UTC, comment #6: 

The comments here are confused.  It is a user error,
and it is a bug.  The bug is real but the example is wrong,
just as j3p0uk said.  $(call FUNC2,one two) in the example
should be $(call FUNC2,one,two) which does indeed print
one two
with the bug (and it is clearly a bug, not just an enhancement request) but
one
with the patch.

Invalid User ID <#15293>
Wed 22 Jan 2003 01:47:42 PM UTC, comment #5: 

Fixed in CVS.  See attached patch.

Paul D. Smith <psmith>
Group administrator
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>
Group administrator
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>
Group administrator

 

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

Attach Files:
   
   
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

 

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.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2003-01-22 psmith Open/ClosedOpen None
    Fixed ReleaseNone None
2003-01-22 psmith StatusNone None

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code