bugmake - Bugs: bug #12992, doc bug: ifdef documentation is...

 
 

bug #12992: doc bug: ifdef documentation is self-contradictory

Submitted by:  None
Submitted on:  Thu 05 May 2005 07:35:20 PM UTC  
 
Severity: 2 - MinorItem Group: Documentation
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.80Operating 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.

 

Sat 07 May 2005 04:23:14 PM UTC, comment #2:

I've rewritten this section to hopefully be more understandable, and added an example.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 06 May 2005 03:31:44 PM UTC, comment #1:

I can see where you're confused, but the documentation is actually correct. It probably needs to be expanded and made more clear, though.

What it's saying is that the text after the ifdef is expanded. The results of the expansion are taken to be the NAME of a variable. The contents of that variable are NOT expanded: if the variable exists and the contents are not empty, then the TRUE segment is in effect. Otherwise, the FALSE segment is in effect. Consider this:

FOO = $(EMPTY)
SOMEVARNAME = FOO
ifdef $(SOMEVARNAME)
...TRUE...

Here, the TRUE segment is taken. The text after the ifdef ($(SOMEVARNAME)) is expanded, to obtain a value of "FOO". "FOO" is considered to be a variable name, but that variable itself is not expanded. Make just checks whether it has any text at all, which it does.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Thu 05 May 2005 07:35:20 PM UTC, original submission:

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

says:
If the variable variable-name has a non-empty value, the text-if-true is effective; otherwise, the text-if-false, if any, is effective.

it goes on to say in the next paragraph:
Note that ifdef only tests whether a variable has a value. It does not expand the variable to see if that value is nonempty.

It also contradicts itself in having the first paragraph claim that ifdef expands variable-name, whereas the second claims it does not.

One of the two paragraphs must go (preferably the one that is inaccurate).

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

 

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

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:15:39 AM UTCpsmithFixed Release4.0=>3.81
Sat 07 May 2005 04:23:14 PM UTCpsmithStatusNone=>Fixed
  Assigned toNone=>psmith
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.0
Fri 06 May 2005 03:31:44 PM UTCpsmithSeverity3 - Normal=>2 - Minor

Back to the top


Powered by Savane 3.1-cleanup1