make/tests/scripts/variables
Paul Smith 2611e1991f Introduce a --warn command line option
Replace the singleton --warn-undefined-variables with infrastructure
to manage multiple warnings: the --warn option can take an action
"ignore", "warn", or "error" (which will apply to all warnings), or
a specific warning type and an action for that type.  Multiple
options can be provided and are consolidated.

* NEWS: Announce the new option.
* doc/make.1: Document in the man page.
* doc/make.texi (Warnings): Document in the user's manual.
* Makefile.am: Add new header warning.h.
* src/warning.h: Define enum for actions and warning types, and
macros to test whether they are set.  Keep the default settings
separate so that we can correctly reconstruct MAKEFLAGS.
* src/makeint.h: Remove deprecated warn_undefined_variables_flag.
* src/main.c: Create global variables to hold warning settings.
(switches): Add a new switch for --warn.
(initialize_warnings): Set the default warning actions.
(main): Call initialize_warnings().
(encode_warning_state, decode_warning_state): Convert warning states
between strings and enums.
(encode_warning_name, decode_warning_name): Convert warning names
between strings and enums.
(decode_warn_flags): Convert a --warn option into enum values.  If
deprecated warn_undefined_variables_flag is set convert it to --warn.
(decode_switches): Don't remove duplicates of --warn since order
matters.  Call decode_warn_flags() to handle --warn.
(define_makeflags): Special-case handling of --warn options written
to MAKEFLAGS: write out the current settings.
* src/read.c (tilde_expand): Use new warning control macros.
* src/variable.c (warn_undefined): Ditto.
* src/job.c (construct_command_argv): Ditto.
* tests/scripts/options/warn: Rename from warn-undefined-variables
and add tests for --warn.
* tests/scripts/variables/MAKEFLAGS: Expect the new behavior.
2023-04-01 11:13:12 -04:00
..
automatic [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
CURDIR
DEFAULT_GOAL
define
EXTRA_PREREQS
flavors Directly handle $\ line endings 2023-02-26 17:30:15 -05:00
GNUMAKEFLAGS Don't add GNUMAKEFLAGS to the environment 2022-06-19 14:35:27 -04:00
INCLUDE_DIRS tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
LIBPATTERNS
MAKE
MAKE_RESTARTS * tests/scripts/variables/MAKE_RESTARTS: Remove TAB chars 2022-02-27 18:01:13 -05:00
MAKECMDGOALS
MAKEFILES
MAKEFLAGS Introduce a --warn command line option 2023-04-01 11:13:12 -04:00
MAKELEVEL
MFILE_LIST
negative Directly handle $\ line endings 2023-02-26 17:30:15 -05:00
private [SV 61463] Don't export inherited private variables 2023-01-02 23:02:33 -05:00
SHELL [SV 62654] Support GNU Make on z/OS 2023-01-08 10:45:38 -05:00
special Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
undefine