bugmake - Bugs: bug #49841, flavor() function incorrectly...

 
 

bug #49841: flavor() function incorrectly shows function parameters as defined.

Submitter:  None
Submitted:  Wed 14 Dec 2016 03:33:07 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.2.1 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 25 Jun 2017 06:05:10 PM UTC, comment #1: 


> It appears that the scope of the parameters in the outer function intrudes into the inner function for the flavor() function but not for the value of the parameter.


The origin() function is also affected.


When inner function takes less arguments than the outer one, make hides "extra" arguments of outer scope by defining them with empty values in the scope of inner function.

Moreover, these "hidden" arguments are automatic, so can't be redefined, for example by $(eval 2:=aaa)

This looks like inconsistency - behavior of inner function depends on the number of arguments of outer one.

May be better solution will be - instead of defining fake arguments in context of inner function, just forbid looking up arguments in outer scope?

The patch (against git repository) is attached.

(file #41043)

Michael Builov <mbuilov>
Wed 14 Dec 2016 03:33:07 PM UTC, original submission:  

This concerns the scope of function parameters when using the
flavor() function to see if they are defined.

Consider the following functions and subsequent calls:

inner =\
  $(info 1F="$(flavor 1)" 1V="$(1)" 2F="$(flavor 2)" 2V="$(2)")
outer = $(call inner,one)

$(call outer,one)
$(call outer,one,two)

This will produce the following output with make-4.2.90

1F="simple" 1V="one" 2F="undefined" 2V=""
1F="simple" 1V="one" 2F="simple"    2V=""

It appears that the scope of the parameters in the outer function intrudes into the inner function for the flavor() function but not for the value of the parameter.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41043:  gnu-make-git-49841.patch added by mbuilov (8KiB - application/octet-stream - patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mbuilov (Updated 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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-25 mbuilov Attached File- Added gnu-make-git-49841.patch, #41043

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code