make/tests/scripts/options
Paul Smith 03ecd94488 Add new warnings invalid-var and invalid-ref
The "invalid-var" warning triggers if the makefile attempts to assign
a value to an invalid variable name (a name containing whitespace).
The "invalid-ref" warning triggers if the makefile attempts to
reference an invalid variable name.  Both new warnings have a default
action of "warn".

* NEWS: Add these new warnings.
* doc/make.1: Document them in the man page.
* doc/make.texi (Warnings): Document them in the user's manual.
* src/warning.h: Add enum values for the new warning types.
* src/main.c (initialize_warnings): Initialize the new warnings.
* src/variable.h (undefine_variable_in_set, undefine_variable_global):
Ask callers to provide a struct floc specifying where the variable
is undefined.
* src/read.c (do_undefine): Pass floc when undefining.
* src/variable.c (check_valid_name): If invalid-var is enabled, check
the variable name.
(define_variable_in_set): Call it.
(undefine_variable_in_set): Ditto.
(check_variable_reference): If invalid-ref is enabled, check the
variable reference.
(lookup_variable): Call it.
(lookup_variable_in_set): Ditto.
* tests/scripts/options/warn: Add tests for the new warning types.
2023-04-01 11:13:12 -04:00
..
dash-B
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
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
dash-W
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 Add new warnings invalid-var and invalid-ref 2023-04-01 11:13:12 -04:00