head 1.11; access; symbols netbsd-11-0-RC4:1.11 netbsd-11-0-RC3:1.11 netbsd-11-0-RC2:1.11 netbsd-11-0-RC1:1.11 perseant-exfatfs-base-20250801:1.11 netbsd-11:1.11.0.2 netbsd-11-base:1.11 netbsd-10-1-RELEASE:1.4 perseant-exfatfs-base-20240630:1.7 perseant-exfatfs:1.7.0.2 perseant-exfatfs-base:1.7 netbsd-10-0-RELEASE:1.4 netbsd-10-0-RC6:1.4 netbsd-10-0-RC5:1.4 netbsd-10-0-RC4:1.4 netbsd-10-0-RC3:1.4 netbsd-10-0-RC2:1.4 netbsd-10-0-RC1:1.4 netbsd-10:1.4.0.2 netbsd-10-base:1.4 cjep_sun2x-base1:1.3 cjep_sun2x:1.3.0.4 cjep_sun2x-base:1.3 cjep_staticlib_x-base1:1.3 cjep_staticlib_x:1.3.0.2 cjep_staticlib_x-base:1.3; locks; strict; comment @# @; 1.11 date 2025.06.11.18.49.58; author sjg; state Exp; branches; next 1.10; commitid RCofMoY43BGqlvYF; 1.10 date 2025.03.30.09.51.50; author rillig; state Exp; branches; next 1.9; commitid veGmSzVhPiW2G4PF; 1.9 date 2025.01.11.20.54.45; author rillig; state Exp; branches; next 1.8; commitid v92duHXtj62ZR6FF; 1.8 date 2024.08.06.18.00.16; author rillig; state Exp; branches; next 1.7; commitid 1R0ZDok3menTZMkF; 1.7 date 2023.06.28.06.15.42; author rillig; state Exp; branches 1.7.2.1; next 1.6; commitid 1030SE3452ts7GuE; 1.6 date 2023.06.01.20.56.35; author rillig; state Exp; branches; next 1.5; commitid j3tIvMRlxolKQhrE; 1.5 date 2023.03.04.21.15.30; author rillig; state Exp; branches; next 1.4; commitid 0PpMOLQmDPUlPQfE; 1.4 date 2021.12.11.09.53.53; author rillig; state Exp; branches; next 1.3; commitid 78ojO69wMnpFqdkD; 1.3 date 2020.11.15.14.07.53; author rillig; state Exp; branches; next 1.2; commitid 9mJf8QxpSpxVpZvC; 1.2 date 2020.11.07.14.37.31; author rillig; state Exp; branches; next 1.1; commitid DMT8hXZffC1EQXuC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.7.2.1 date 2025.08.02.05.58.31; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.11 log @make: check variable names for invalid characters Variable names should not contain white-space. As is; make quietly ignores gmake syntax like $(addprefix -I, $(INCLUDE_DIR_LIST)) which means we are not doing what the makefile wants, and the user has no clue. CheckVarname is called only if there are no modifiers to be applied as :L and others legitimately can handle white-space, it will issue a warning if illegal characters are found. Currently only white-space is checked. The NetBSD build produces a few warnings - in one case a makefile intended for gmake, and the other some dubious constructs by bsd.prog.mk in support of ATF tests such as OBJS.${PROG} when PROG is actually a list. Reviewed by: rillig @ text @make: cond-func-empty.mk:156: warning: Invalid character " " in variable name " WORD " make: cond-func-empty.mk:168: Unclosed variable "WORD" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.10 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @d1 2 a2 1 make: cond-func-empty.mk:167: Unclosed variable "WORD" @ 1.9 log @make: omit redundant follow-up message "Malformed conditional" If there is a parse error or an evaluation error during the conditional, the conditional is already mentioned in the "while evaluating condition" line, so there's no reason to repeat it once again. Same for the "Bad condition" message from the '?:' modifier. @ text @d1 1 a1 1 make: "cond-func-empty.mk" line 167: Unclosed variable "WORD" @ 1.8 log @make: in error message about conditionals, use single quotes Single quotes are used less often in the conditionals themselves, which leads to fewer confusions. @ text @d1 1 a1 2 make: "cond-func-empty.mk" line 168: Unclosed variable "WORD" make: "cond-func-empty.mk" line 168: Malformed conditional 'empty(WORD' @ 1.7 log @tests/make: extend test for the 'empty' function in conditions @ text @d2 1 a2 1 make: "cond-func-empty.mk" line 168: Malformed conditional (empty(WORD) @ 1.7.2.1 log @Sync with HEAD @ text @d1 2 a2 2 make: cond-func-empty.mk:156: warning: Invalid character " " in variable name " WORD " make: cond-func-empty.mk:168: Unclosed variable "WORD" @ 1.6 log @tests/make: force line-based diagnostics to be listed in the tests This way, contradictions between the intended output and the actual output are closer together and have a better chance of being spotted. @ text @d1 2 a2 2 make: "cond-func-empty.mk" line 154: Unclosed variable "WORD" make: "cond-func-empty.mk" line 154: Malformed conditional (empty(WORD) @ 1.5 log @tests/make: improve explanations in test for 'empty' function @ text @d1 2 a2 2 make: "cond-func-empty.mk" line 153: Unclosed variable "WORD" make: "cond-func-empty.mk" line 153: Malformed conditional (empty(WORD) @ 1.4 log @tests/make: proofread and clean up comments for function 'empty' This prepares a refactoring for handling the function 'empty' in conditionals like '.if'. The function 'empty' is fundamentally different from all other functions since it is parsed differently and passes its result on different path than the other functions. Splitting up these code paths will untangle the control flow of parsing a condition like 'empty(VARNAME)'. It will also remove several ARGSUSED and MAKE_ATTR_UNUSED that make the current code smell. @ text @d1 2 a2 2 make: "cond-func-empty.mk" line 149: Unclosed variable "WORD" make: "cond-func-empty.mk" line 149: Malformed conditional (empty(WORD) @ 1.3 log @make(1): clean up some tests Fix some mistakes in comments. Improve some comments to be easier understandable. Inline variables that are irrelevant for the test at hand (RUN, MAKE_CMD). Remove references to functions and constants that have since been removed or renamed. @ text @d1 2 a2 2 make: "cond-func-empty.mk" line 152: Unclosed variable "WORD" make: "cond-func-empty.mk" line 152: Malformed conditional (empty(WORD) @ 1.2 log @make(1): add test for parse error in condition using empty() @ text @d1 2 a2 2 make: "cond-func-empty.mk" line 150: Unclosed variable "WORD" make: "cond-func-empty.mk" line 150: Malformed conditional (empty(WORD) @ 1.1 log @make(1): add dummies for fine-grained tests, one per single feature The test names have been derived from the current manual page. All these tests are dummies right now, and the code from the existing tests will be moved into the new tests step by step. This is done to prevent modmisc, escape, varmod-edge and varmisc from growing without any bounds, and to reduce the side-effects of one test to the others. @ text @d1 5 a5 1 exit status 0 @