make/tests/scripts/functions
Dmitry Goncharov a382ac6cd1 [SV 64803] Set origin for unmodified variables after -e
Ensure the origin of all variables inherited from the environment is
"environment override" if -e is given.  Previously only variables
that were set in the makefile had this origin.

PDS: Most of these changes are from Dmitry but I slightly modified
the algorithm: instead of rearranging the way in which MAKEFLAGS is
parsed we reset the env_override value to the default before we
re-parse MAKEFLAGS, then we set the origin of all env vars to the
correct value based on the new setting.

* NEWS: Mention the change for backward-compatibility.
* src/main.c (main): Ensure MAKEFLAGS is always marked special.
(reset_makeflags): Set env_overrides back to default before parsing
MAKEFLAGS.
(decode_switches): Call reset_env_override() to check for changes.
* src/variable.h (reset_env_override): Declare a new function.
* src/variable.c (reset_env_override): Go through all env variables
and ensure the origin is correct based on env_overrides.
(set_env_override): Helper function for the hash.
* tests/scripts/functions/foreach: Fix tests.
* tests/scripts/functions/let: Ditto.
* tests/scripts/functions/origin: Ditto.
* tests/scripts/options/dash-e: Add tests.
2024-02-04 11:34:49 -05:00
..
abspath Add test suite support to Windows 2017-06-04 18:37:20 -04:00
addprefix
addsuffix
andor
basename
call [SV 46995] Strip leading/trailing space from variable names 2016-03-23 01:25:51 -04:00
dir
error [SV 46433] Show recipe line offsets in line number messages. 2016-04-11 07:51:05 -04:00
eval Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
file [SV 17448] Ignore whitespace around $(file ...) names 2023-01-08 18:06:54 -05:00
filter-out [SV 59093] Rewrite filter/filter-out to avoid large stack usage 2020-11-13 00:44:24 -05:00
findstring
flavor
foreach [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
guile Clean up memory leak warnings from ASAN and Valgrind 2023-04-01 11:13:12 -04:00
if
intcmp * src/function.c (parse_textint): Handle ints without 0 properly. 2022-01-17 19:11:59 -05:00
join
let [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
notdir
origin [SV 64803] Set origin for unmodified variables after -e 2024-02-04 11:34:49 -05:00
realpath tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
shell [SV 65172] Avoid buffer overruns when expanding for $(shell ...) 2024-01-27 16:40:36 -05:00
sort [SV 46995] Strip leading/trailing space from variable names 2016-03-23 01:25:51 -04:00
strip
substitution
suffix
value Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
warning [SV 46433] Show recipe line offsets in line number messages. 2016-04-11 07:51:05 -04:00
wildcard Clean up memory leak warnings from ASAN and Valgrind 2023-04-01 11:13:12 -04:00
word Use a well-known error string for out-of-bound function arguments 2021-12-19 16:34:19 -05:00