bug-make
[Top][All Lists]
Advanced

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

[bug #63439] [Regression] --no-builtin-variables with --warn-undefined-v


From: Pekka S
Subject: [bug #63439] [Regression] --no-builtin-variables with --warn-undefined-variables trigger warning on GNUMAKEFLAGS
Date: Tue, 29 Nov 2022 05:02:57 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63439>

                 Summary: [Regression] --no-builtin-variables with
--warn-undefined-variables trigger warning on GNUMAKEFLAGS
                 Project: make
               Submitter: pexu
               Submitted: Tue 29 Nov 2022 10:02:55 AM UTC
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.4
        Operating System: None
           Fixed Release: None
           Triage Status: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 29 Nov 2022 10:02:55 AM UTC By: Pekka S <pexu>
Hi.

GNU make 4.4 always attemps to expand GNUMAKEFLAGS.  This causes warning
"make: warning: undefined variable 'GNUMAKEFLAGS'" to be emitted unless the
variable exists.

Reproducing this is very easy (unless there is a Makefile to go there will be
an error afterwards but that is unrelated).  One shall also ensure that there
is no corresponding GNUMAKEFLAGS environment variable present.

$ (unset GNUMAKEFLAGS; make --no-builtin-variables
--warn-undefined-variables)
make: warning: undefined variable 'GNUMAKEFLAGS'
[...]

Typically GNUMAKEFLAGS is always set via define_default_variables() at
default.c:744
<https://git.savannah.gnu.org/cgit/make.git/tree/src/default.c?h=4.4#n744>. 
However, if --no-builtin-variables is given then default_variables is not
iterated.  Also, GNUMAKEFLAGS is no longer automatically added to the
environment (commit 3ec497f8
<https://git.savannah.gnu.org/cgit/make.git/commit/?id=3ec497f8f803cb5772528712b878f111a2631795>)
during the first decode phase at main.c:1575
<https://git.savannah.gnu.org/cgit/make.git/tree/src/main.c?h=4.4#n1575>.

When switches are decoded again GNUMAKEFLAGS is expanded using
decode_env_switches() at main.c:2074
<https://git.savannah.gnu.org/cgit/make.git/tree/src/main.c?h=4.4#n2074>. 
However, this not guarded by lookup_variable().  So when the constructed
variable '$(GNUMAKEFLAGS)' is expanded variable_expand_string() complains (and
rightfully so) about the missing variable.

A workaround is to always provide (an empty) GNUMAKEFLAGS environment
variable.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63439>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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