From a0d1e76d604df5bd006fd5ed6a69963d3c6b4d7a Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 18 Mar 2023 17:24:45 -0400 Subject: Add support for .WARNINGS special variable Create a new special variable, .WARNINGS, to allow per-makefile control over warnings. The command line settings will override this. Move the handling of warning flags to a new file: src/warning.c. Allow the decode to work with generic strings, and call it from decode_switches(). * Makefile.am: Add new file src/warning.c. * build_w32.bat: Ditto. * builddos.bat: Ditto. * po/POTFILES.in: Ditto. * src/makeint.h: #define for the .WARNINGS variable name. * src/warning.h: Add declarations for methods moved from main.c. Rename the enum warning_state to warning_action. * src/warning.c: New file. Move all warning encode/decode here from main.c. * src/main.c: Move methods into warning.c and call those methods instead. (main): Set .WARNINGS as a special variable. * src/job.c (construct_command_argv): Rename to warning_action. * src/read.c (tilde_expand): Ditto. * src/variable.c (set_special_var): Update warnings when the .WARNINGS special variable is set. * tests/scripts/options/warn: Check invalid warning options. * tests/scripts/variables/WARNINGS: Add tests for the .WARNINGS special variable. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8741b562..05be3453 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,7 +37,7 @@ make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \ src/mkcustom.h src/os.h src/output.c src/output.h src/read.c \ src/remake.c src/rule.c src/rule.h src/shuffle.h src/shuffle.c \ src/signame.c src/strcache.c src/variable.c src/variable.h \ - src/version.c src/vpath.c src/warning.h + src/version.c src/vpath.c src/warning.c src/warning.h w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \ src/w32/compat/posixfcn.c src/w32/include/dirent.h \ -- cgit v1.2.1