]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 64085] Handle .POSIX plus .IGNORE correctly
authorPaul Smith <psmith@gnu.org>
Mon, 5 Feb 2024 00:41:50 +0000 (19:41 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 5 Feb 2024 00:41:50 +0000 (19:41 -0500)
commit3176b60566615074a4d143cdcdc55fc95f183d6a
tree788352109c240ad945998a59acbc4790562c6fc9
parent07187db947ba25e6c59b55f10660a04f8e9c5229
[SV 64085] Handle .POSIX plus .IGNORE correctly

POSIX requires that a conforming makefile should not use -e if
 1) make is invoked with -i
 2) A .IGNORE target exists with no prerequisites
 3) The current target is a prerequisite of .IGNORE

* src/job.c (start_job_command): Add the target's flags when
constructing argv so it can check (3) above.
(construct_command_argv_internal): Don't set shellflags if it's not
set: this only happens if we're parsing for the slow path and we
don't need them.
(construct_command_argv): Don't allocate buffers if not needed.
When detecting "-ec", check the global ignore_errors_flag and the
current command line flags.
* tests/scripts/targets/IGNORE: Add tests for .IGNORE.
* tests/scripts/targets/POSIX: Add tests for the three cases above.
src/job.c
tests/scripts/targets/IGNORE [new file with mode: 0644]
tests/scripts/targets/POSIX