[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #56206] ifndef false positive for exported variable

From: Paul D. Smith
Subject: [bug #56206] ifndef false positive for exported variable
Date: Sun, 12 May 2019 18:42:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0

Update of bug #56206 (project make):

                  Status:                    None => Not A Bug              
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

This behavior is correct.  The confusion is because the ?= operator and the
ifndef operator have different behaviors for variables which are defined to
have an empty value.

ifdef/ifndef test whether the expansion of the variable is the empty string or

ifndef variable-name

    If the variable variable-name has an empty value, the text-if-true is
    otherwise, the text-if-false, if any, is effective.

However, the ?= operator tests whether the variable is actually defined or
not, not whether it has an empty value:

There is another assignment operator for variables, ‘?=’. This is called a
variable assignment operator, because it only has an effect if the variable is
yet defined. This statement:

  FOO ?= bar

is exactly equivalent to this (see The origin Function):

  ifeq ($(origin FOO), undefined)
    FOO = bar

  Note that a variable set to an empty value is still defined, so ‘?=’
will not set that variable. 


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]