bugmake - Bugs: bug #32498, export within $(eval) within a...

 
 

bug #32498: export within $(eval) within a $(call) broken?

Submitted by:  None
Submitted on:  Tue 15 Feb 2011 10:05:04 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.82Operating System: Any
Fixed Release: 4.0Triage Status: Verified

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 12 Sep 2011 05:36:12 AM UTC, comment #4:

Fixed in CVS. Thanks for the report.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Wed 16 Feb 2011 10:30:04 AM UTC, comment #3:

Thanks Paul and Olexiy.

I don't agree with you, Olexiy, in that 'export' only exports defined variables. Documentation at least does not mention this, and Paul's test with the 'export AA' shows it.

Otherwise, Paul's code is a much more concise test than mine, and reproduces the exact problem.

Waiting for your investigations :)
Anthony

Anonymous
Tue 15 Feb 2011 10:34:03 PM UTC, comment #2:

I don't know, something seems wrong here to me. If you have:

Then I see no rational reason offhand why make will correctly export AA and AB as empty, but not export AC.

This needs more investigation.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 15 Feb 2011 10:31:17 PM UTC, comment #1:

http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion

As I understand it export do really export of defined variables
and has to be

define test1
AA=
$(eval export AA)
endef

Olexiy Buyanskyy <olexiyb>
Tue 15 Feb 2011 10:05:04 PM UTC, original submission:

Hi,

After a long bug hunting in a set of complex Makefiles, I came up with that simple test that let me think there is a problem in gmake itself:

-- cut here --
define test1
$(eval export AA)
endef

define test2
$(eval export AB=)
endef

define test3
$(eval export AC=x)
endef

$(call test1)
$(call test2)
$(call test3)
$(eval export AD)

all:
env | grep ^A
-- cut here --

The output from gmake is :
env | grep ^A
AB=
AC=x
AD=

Note that 'AA' variable is not exported.
I can reproduce this with gmake-3.81 or 3.82, on different platforms (Linux, NetBSD).

Am I missing something, or is there really a problem here?

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by olexiyb (Posted a comment)
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Sep 2011 05:36:12 AM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
    Tue 15 Feb 2011 10:34:03 PM UTCpsmithTriage StatusNone=>Verified

    Back to the top


    Powered by Savane 3.1-cleanup1