make/tests/scripts/options
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
..
dash-B [SV 102] Don't show unnecessary include file errors. 2016-04-09 20:06:46 -04:00
dash-C Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
dash-d * src/main.c (decode_debug_flags): [SV 607777] Preserve -d options 2021-09-06 20:36:15 -04:00
dash-e [SV 61218] Ensure MAKEFLAGS is expanded even with -e 2023-01-08 16:40:55 -05:00
dash-f * tests/scripts/features/reinvoke: Warn about closing STDIN. 2023-01-11 20:35:11 -05:00
dash-I tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
dash-k [SV 56301] Fail if an included makefile can't be built 2022-09-20 03:55:39 -04:00
dash-l * tests/scripts/options/dash-l: Simplify the test via the helper 2023-02-26 13:46:02 -05:00
dash-n * tests/run_make_test.pl: Fix support for valgrind. 2019-09-21 15:13:24 -04:00
dash-q [SV 47151] Exit with 1 when checking recursive make -q 2016-02-29 01:33:50 -05:00
dash-r [SV 62356] If -R is set in the makefile, disable -r 2022-04-24 10:39:32 -04:00
dash-s [SV 63537] Document and test flippable switches 2022-12-18 20:06:38 -05:00
dash-t Commit fix for bug #1418. 2003-03-25 00:15:25 +00:00
dash-W [SV 102] Don't show unnecessary include file errors. 2016-04-09 20:06:46 -04:00
eval Add test suite support to Windows 2017-06-04 18:37:20 -04:00
general Add test suite support to Windows 2017-06-04 18:37:20 -04:00
print-directory Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
shuffle [SV 63047] Fix shuffle of SECONDEXPANSION prerequisites 2022-09-12 01:05:31 -04:00
symlinks Enhance tests to work on different systems 2022-10-22 22:37:49 -04:00
warn Introduce a --warn command line option 2023-04-01 11:13:12 -04:00