[Top][All Lists]

[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)


                 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>

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
make: warning: undefined variable 'GNUMAKEFLAGS'

Typically GNUMAKEFLAGS is always set via define_default_variables() at
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
during the first decode phase at main.c:1575

When switches are decoded again GNUMAKEFLAGS is expanded using
decode_env_switches() at main.c:2074
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


Reply to this item at:


Message sent via Savannah

reply via email to

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