]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 63439, SV 63452] Don't warn on undefined internal variables
authorPaul Smith <psmith@gnu.org>
Sat, 24 Dec 2022 15:30:13 +0000 (10:30 -0500)
committerPaul Smith <psmith@gnu.org>
Sat, 24 Dec 2022 15:52:49 +0000 (10:52 -0500)
commit15dfad96d77c9445d11be939a5042675e4ca8c65
tree34e2b52a28a894db8ecf01e15103aa511ba104e1
parent76d2e5d98dbbf655f74f6ef2f6dd3cdd45052ea0
[SV 63439, SV 63452] Don't warn on undefined internal variables

Don't generate undefined variable warnings for variables that are
internal / special to make and where the empty string is valid.
Rather than defining them to empty, which could introduce unwanted
behavior, keep a list of variable names which we should never warn
about.

* src/variable.h (warn_undefined): Convert the macro to a function.
* src/variable.c (defined_vars): Always "defined" variable names.
(warn_undefined): Implement as a function and check against the
defined_vars before generating a warning.
* src/read.c (read_all_makefiles): No need to reset warning flag.
* src/vpath.c (build_vpath_lists): Ditto.
* tests/scripts/options/warn-undefined-variables: Expand all the
pre-defined variables to ensure warnings are not generated.
src/read.c
src/variable.c
src/variable.h
src/vpath.c
tests/scripts/options/warn-undefined-variables