bugmake - Bugs: bug #18995, variable origin changes upon...

 
 

bug #18995: variable origin changes upon export or unexport

Submitted by:  Sam Yates <halfflat>
Submitted on:  Thu 08 Feb 2007 12:57:33 PM UTC  
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  None Operating System:  Any
Fixed Release:  None Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sat 10 Feb 2007 06:41:33 PM UTC, comment #1: 

Internally to make, an "undefined" origin means that the variable is not known to make (when make looks it up in its internal tables, nothing is found).

Obviously, once you export or unexport a variable, it has to be added to make's internal tables so make can remember that you marked it as exported or unexported... so then it's no longer undefined.

I can understand your point, however.  I've marked this as an enhancement request.  It shouldn't be too difficult to implement: a new origin value for undefined would need to be added, which is easy... but then all the places the origin is used would need to be examined to determine if or how they should react when a variable in this new state is found.

This would also allow us to create a way to "undefine" a variable; currently once a variable is defined it can never go back to the undefined state again.

Paul D. Smith <psmith>
Project Administrator
Thu 08 Feb 2007 12:57:33 PM UTC, original submission:  

Exporting or unexporting a variable that is undefined, changes its origin to 'file'.

Expected behaviour is for export and (especially) unexport not to change the origin of an undefined variable, so that (for example) conditional assignments such as FOO?=foo behave as expected even after an export or unexport.

Example makefile:

$(info origin of FOO: $(origin FOO))
unexport FOO
$(info after 'unexport FOO': origin of FOO: $(origin FOO))

$(info origin of BAR: $(origin BAR))
export BAR
$(info after 'export BAR': origin of BAR: $(origin BAR))

.PHONY: dummy;
dummy: ;@:

Output:

origin of FOO: undefined
after 'unexport FOO': origin of FOO: file
origin of BAR: undefined
after 'export BAR': origin of BAR: file

Make version 3.81, x86_64-pc-linux-gnu.

Sam Yates <halfflat>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by halfflat (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-10 psmith Item GroupNone => Enhancement
        Operating SystemNone => Any

    Back to the top


    Powered by Savane 3.5