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

 
 

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

Submitter:  None
Submitted:  Thu 05 May 2005 07:35:20 PM UTC
   
 
Severity:  2 - Minor Item Group:  Documentation
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.80 Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

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

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2005-05-07 psmith StatusNone Fixed
    Assigned toNone psmith
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0
2005-05-06 psmith Severity3 - Normal 2 - Minor

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code