head 1.27; access; symbols perseant-exfatfs-base-20261102:1.27 netbsd-11-1-RELEASE:1.27 netbsd-10-2-RELEASE:1.17 netbsd-11-0-RELEASE:1.27 netbsd-11-0-RC7:1.27 netbsd-11-0-RC6:1.27 netbsd-11-0-RC5:1.27 netbsd-11-0-RC4:1.27 netbsd-11-0-RC3:1.27 netbsd-11-0-RC2:1.27 netbsd-11-0-RC1:1.27 perseant-exfatfs-base-20250801:1.27 netbsd-11:1.27.0.2 netbsd-11-base:1.27 netbsd-10-1-RELEASE:1.17 perseant-exfatfs-base-20240630:1.20 perseant-exfatfs:1.20.0.2 perseant-exfatfs-base:1.20 netbsd-10-0-RELEASE:1.17 netbsd-10-0-RC6:1.17 netbsd-10-0-RC5:1.17 netbsd-10-0-RC4:1.17 netbsd-10-0-RC3:1.17 netbsd-10-0-RC2:1.17 netbsd-10-0-RC1:1.17 netbsd-10:1.17.0.6 netbsd-10-base:1.17 cjep_sun2x-base1:1.17 cjep_sun2x:1.17.0.4 cjep_sun2x-base:1.17 cjep_staticlib_x-base1:1.17 cjep_staticlib_x:1.17.0.2 cjep_staticlib_x-base:1.17; locks; strict; comment @# @; 1.27 date 2025.06.28.22.39.29; author rillig; state Exp; branches; next 1.26; commitid CDDpACH2g2jV3I0G; 1.26 date 2025.06.12.04.33.00; author rillig; state Exp; branches; next 1.25; commitid bkeXvOoQ1rQizyYF; 1.25 date 2025.03.30.09.51.51; author rillig; state Exp; branches; next 1.24; commitid veGmSzVhPiW2G4PF; 1.24 date 2025.01.14.21.23.17; author rillig; state Exp; branches; next 1.23; commitid 4sf0C5zaebtxWuFF; 1.23 date 2025.01.11.21.21.34; author rillig; state Exp; branches; next 1.22; commitid NtFvbDJHnW9G17FF; 1.22 date 2024.08.06.17.46.01; author rillig; state Exp; branches; next 1.21; commitid aC6PdWQrVs87VMkF; 1.21 date 2024.07.04.20.18.40; author rillig; state Exp; branches; next 1.20; commitid 75IS4XOhTa8VOygF; 1.20 date 2023.08.19.11.09.02; author rillig; state Exp; branches 1.20.2.1; next 1.19; commitid Wc8jar4Kqapz2oBE; 1.19 date 2023.08.19.10.52.14; author rillig; state Exp; branches; next 1.18; commitid BookaqSA0CGHYnBE; 1.18 date 2023.06.01.20.56.35; author rillig; state Exp; branches; next 1.17; commitid j3tIvMRlxolKQhrE; 1.17 date 2021.04.10.22.09.54; author rillig; state Exp; branches; next 1.16; commitid eT9sGrPfpte5eNOC; 1.16 date 2021.04.05.13.35.41; author rillig; state Exp; branches; next 1.15; commitid y78jOaWq6kEPH6OC; 1.15 date 2021.04.05.13.14.55; author rillig; state Exp; branches; next 1.14; commitid zpXL8mB8Gp4XA6OC; 1.14 date 2021.04.03.22.02.59; author rillig; state Exp; branches; next 1.13; commitid kY1ba3OEWIFRzTNC; 1.13 date 2021.03.15.15.39.13; author rillig; state Exp; branches; next 1.12; commitid rzqU9y7n65mD4qLC; 1.12 date 2021.02.15.18.23.32; author rillig; state Exp; branches; next 1.11; commitid DIbr7uPAeKD6TPHC; 1.11 date 2021.02.02.16.18.16; author rillig; state Exp; branches; next 1.10; commitid 0UA04rhw9vBPA9GC; 1.10 date 2021.02.01.21.56.03; author rillig; state Exp; branches; next 1.9; commitid js7gD5VtJrBxt3GC; 1.9 date 2020.11.07.13.09.13; author rillig; state Exp; branches; next 1.8; commitid CU9QaLoip4WhmXuC; 1.8 date 2020.11.02.22.59.48; author rillig; state Exp; branches; next 1.7; commitid 4xfOKpZi6GDAMmuC; 1.7 date 2020.11.02.22.46.52; author rillig; state Exp; branches; next 1.6; commitid 46RsxxhuZa0GImuC; 1.6 date 2020.11.02.22.44.29; author rillig; state Exp; branches; next 1.5; commitid LwglvQWyNQfwHmuC; 1.5 date 2020.11.02.22.29.48; author rillig; state Exp; branches; next 1.4; commitid 7JuNjVP6POhCCmuC; 1.4 date 2020.11.02.22.16.24; author rillig; state Exp; branches; next 1.3; commitid wEfrqL94RrReymuC; 1.3 date 2020.10.18.08.47.54; author rillig; state Exp; branches; next 1.2; commitid xRX85xvkE6YSwmsC; 1.2 date 2020.09.05.13.34.19; author rillig; state Exp; branches; next 1.1; commitid lr9ubBnC4DzEwRmC; 1.1 date 2020.08.16.12.07.52; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.20.2.1 date 2025.08.02.05.58.40; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.27 log @make: consistently use double quotes in error messages Previously, some error messages used single quotes, very few used backticks or parentheses, most already used double quotes. While here, reword a few error messages to be clearer or more consistent with related error messages. @ text @Global: VAR{{{}}} = 3 braces Var_Parse: ${VAR{{{}}}}" != "3 braces" (eval) Global: VARNAME = VAR((( Var_Parse: ${VARNAME} (eval) Global: VAR((( = 3 open parentheses Var_Parse: ${VAR(((}}}}" != "3 open parentheses}}}" (eval) Global: .ALLTARGETS = VAR(((=) make: varname.mk:31: Missing ")" in archive specification make: varname.mk:31: Error in archive specification: "VAR" Var_Parse: ${:UVAR\(\(\(}= try2 (eval) Evaluating modifier ${:U...} on value "" (eval, undefined) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (eval, defined) Global: .ALLTARGETS = VAR(((=) VAR\(\(\(= make: varname.mk:37: Invalid line "${:UVAR\(\(\(}= try2", expanded to "VAR\(\(\(= try2" Var_Parse: ${VARNAME} (eval) Global: VAR((( = try3 Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: varname.mk:98: warning: Invalid character " " in variable name "if ,yes,no" make: varname.mk:113: warning: Invalid character " " in variable name "if ,yes,no" make: varname.mk:120: warning: Invalid character " " in variable name "if ,," make: varname.mk:128: Unknown modifier ":yes,answer" while evaluating variable "if ,answer" with value "" while evaluating variable "GNU_MAKE_IF_MODIFIER" with value "$(if ${HAVE_STRLEN},answer:yes,answer:no)" make: varname.mk:138: warning: Invalid character "\x09" in variable name "a b" make: varname.mk:138: Variable "a b" is undefined make: varname.mk:144: Variable "ÄÖÜ" is undefined make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.26 log @tests/make: add tests for detection of GNU-make-style expressions @ text @d8 1 a8 1 make: varname.mk:31: Missing ')' in archive specification d14 1 a14 1 make: varname.mk:37: Invalid line '${:UVAR\(\(\(}= try2', expanded to 'VAR\(\(\(= try2' @ 1.25 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 @d8 2 a9 2 make: varname.mk:32: Missing ')' in archive specification make: varname.mk:32: Error in archive specification: "VAR" d14 1 a14 1 make: varname.mk:38: Invalid line '${:UVAR\(\(\(}= try2', expanded to 'VAR\(\(\(= try2' d19 9 d29 1 a29 1 make: stopped making "all" in unit-tests @ 1.24 log @make: simplify parsing of dependency lines The evaluation modes that allow or deny undefined variables have the same effect in this case, as Var_Subst does not return an error marker. @ text @d8 2 a9 2 make: "varname.mk" line 32: Missing ')' in archive specification make: "varname.mk" line 32: Error in archive specification: "VAR" d14 1 a14 1 make: "varname.mk" line 38: Invalid line '${:UVAR\(\(\(}= try2', expanded to 'VAR\(\(\(= try2' @ 1.23 log @make: replace "Malformed conditional" with "Variable is undefined" Evaluating a conditional such as ".if ${UNDEF}" produced a "Malformed conditional" error, even though the form of the conditional was correct, it was the content of the variable that was wrong. Replace this message with the more accurate "Variable is undefined", revealing which of the possibly many variables is actually undefined. @ text @d10 1 a10 1 Var_Parse: ${:UVAR\(\(\(}= try2 (eval-defined) @ 1.22 log @make: add details to error messages about missing ')' @ text @d11 2 a12 2 Evaluating modifier ${:U...} on value "" (eval-defined, undefined) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (eval-defined, defined) @ 1.21 log @make: on error, print the targets to be made This helps to understand situations with several nested sub-makes in varying directories. @ text @d8 1 a8 1 make: "varname.mk" line 32: No closing parenthesis in archive specification @ 1.20 log @make: show realistic invalid line in error message Previously, the error message 'Invalid line' showed only the expanded line, which might or might not show the actual problem. To be more helpful, add the unexpanded line to the error message in case they differ. Remove the special handling of invalid lines that result from merge conflicts. RCS is not commonly used anymore, and mentioning CVS was too specific. By echoing the whole line, the patterns '<<<<<<' and '>>>>>>' are clear enough to hint at the problem. @ text @d20 1 a20 1 make: stopped in unit-tests @ 1.20.2.1 log @Sync with HEAD @ text @d8 5 a12 5 make: varname.mk:31: Missing ")" in archive specification make: varname.mk:31: Error in archive specification: "VAR" Var_Parse: ${:UVAR\(\(\(}= try2 (eval) Evaluating modifier ${:U...} on value "" (eval, undefined) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (eval, defined) d14 1 a14 1 make: varname.mk:37: Invalid line "${:UVAR\(\(\(}= try2", expanded to "VAR\(\(\(= try2" a18 9 make: varname.mk:98: warning: Invalid character " " in variable name "if ,yes,no" make: varname.mk:113: warning: Invalid character " " in variable name "if ,yes,no" make: varname.mk:120: warning: Invalid character " " in variable name "if ,," make: varname.mk:128: Unknown modifier ":yes,answer" while evaluating variable "if ,answer" with value "" while evaluating variable "GNU_MAKE_IF_MODIFIER" with value "$(if ${HAVE_STRLEN},answer:yes,answer:no)" make: varname.mk:138: warning: Invalid character "\x09" in variable name "a b" make: varname.mk:138: Variable "a b" is undefined make: varname.mk:144: Variable "ÄÖÜ" is undefined @ 1.19 log @make: add more details to error message about invalid lines @ text @d14 1 a14 1 make: "varname.mk" line 38: Invalid line 'VAR\(\(\(= try2' @ 1.18 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 @d14 1 a14 1 make: "varname.mk" line 38: Invalid line type @ 1.17 log @make: reduce debug logging and memory allocation for ${:U...} Expressions of the form ${:U...} are often generated by .for loops. Since these expressions are not generated knowingly by the make user, do not fill the debug log with them since that would interrupt the normal reading flow of the -dv log for nested expressions. @ text @d8 2 a9 2 make: "varname.mk" line 30: No closing parenthesis in archive specification make: "varname.mk" line 30: Error in archive specification: "VAR" d14 1 a14 1 make: "varname.mk" line 35: Invalid line type @ 1.16 log @make: in debug log, add space between scope and variable name Without this space, the debug log looked more like line noise, even though the only punctuation was a single innocent ':'. From a make user's perspective, the variable name is a word of its own and should not be visually glued to its namespace. @ text @a6 3 Var_Parse: ${:UVAR(((}= try1 (eval-defined) Evaluating modifier ${:U...} on value "" (eval-defined, undefined) Result of ${:UVAR(((} is "VAR(((" (eval-defined, defined) @ 1.15 log @make: be more verbose in -dv debug logging The previous log output was too brief to be understandable. Give more hints by describing each part of the expression when evaluating a modifier. Distinguish between parse-only mode and eval mode since in parse-only mode most of the details are irrelevant. @ text @d1 1 a1 1 Global:VAR{{{}}} = 3 braces d3 1 a3 1 Global:VARNAME = VAR((( d5 1 a5 1 Global:VAR((( = 3 open parentheses d10 1 a10 1 Global:.ALLTARGETS = VAR(((=) d16 1 a16 1 Global:.ALLTARGETS = VAR(((=) VAR\(\(\(= d19 3 a21 3 Global:VAR((( = try3 Global:.MAKEFLAGS = -r -k -d v -d Global:.MAKEFLAGS = -r -k -d v -d 0 @ 1.14 log @make: remove VarFlags from debug logging Before the introduction of ExprDefined, VarFlags contained whether the expression was defined or not, which was useful to know since the final value of the expression depends on this information. The other VarFlags do not influence the evaluation, so there is no point logging them. @ text @d8 1 a8 1 Applying ${:U...} to "" (eval-defined, undefined) d14 1 a14 1 Applying ${:U...} to "" (eval-defined, undefined) @ 1.13 log @make: change debug log for variable evaluation flags to lowercase This makes them easier distinguishable from variable names since the latter are usually uppercase. No functional change outside debug mode. @ text @d8 2 a9 2 Applying ${:U...} to "" (eval-defined, none, undefined) Result of ${:UVAR(((} is "VAR(((" (eval-defined, none, defined) d14 2 a15 2 Applying ${:U...} to "" (eval-defined, none, undefined) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (eval-defined, none, defined) @ 1.12 log @make: rename ExprDefined constants for debug logging @ text @d2 1 a2 1 Var_Parse: ${VAR{{{}}}}" != "3 braces" with VARE_WANTRES d4 1 a4 1 Var_Parse: ${VARNAME} with VARE_WANTRES d6 4 a9 4 Var_Parse: ${VAR(((}}}}" != "3 open parentheses}}}" with VARE_WANTRES Var_Parse: ${:UVAR(((}= try1 with VARE_UNDEFERR|VARE_WANTRES Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, undefined) Result of ${:UVAR(((} is "VAR(((" (VARE_UNDEFERR|VARE_WANTRES, none, defined) d13 3 a15 3 Var_Parse: ${:UVAR\(\(\(}= try2 with VARE_UNDEFERR|VARE_WANTRES Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, undefined) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, defined) d18 1 a18 1 Var_Parse: ${VARNAME} with VARE_WANTRES @ 1.11 log @make: replace VarExprFlags with VarExprStatus The combination of !VEF_UNDEF && VEF_DEF was not possible, which made it rather strange to model this state as a bit set. The only functional change is the renamed constants in the debug output. Using ENUM_VALUE_RTTI_2 felt like overengineering since it's harder to understand than a simple array of names. @ text @d8 2 a9 2 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF) Result of ${:UVAR(((} is "VAR(((" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF) d14 2 a15 2 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VES_UNDEF) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, VES_DEF) @ 1.10 log @make: replace parse error "Need an operator" with better message The previous error message is not easily understandable since it is missing a crucial detail, the column where the operator is needed. Without this information, the author of the makefile gets no useful hint. Furthermore, there are several types of operators in makefiles: the dependency operators ':', '!', '::', the variable assignment operators '=', '!=', '+=', '?=', ':=', the conditional operators '&&', '||', '!', the comparison operators '==', '!=', '>', '>=', '<', '<='. This leaves too much ambiguity. Replace this error message with "Invalid line type", which is more generic, more accurate and thus less misleading. @ text @d8 2 a9 2 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF) Result of ${:UVAR(((} is "VAR(((" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF) d14 2 a15 2 Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF) @ 1.9 log @make(1): properly handle errors for malformed archive target names Error messages don't belong on stdout. @ text @d17 1 a17 1 make: "varname.mk" line 35: Need an operator @ 1.8 log @make(1): document test for parsing of variable assignments @ text @d11 1 a11 1 No closing parenthesis in archive specification @ 1.7 log @make(1): fix line numbers in test output of varname.mk @ text @d17 3 a19 5 make: "varname.mk" line 31: Need an operator Var_Parse: ${:UVAR\(\(\(}= try3 with VARE_UNDEFERR|VARE_WANTRES Applying ${:U...} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF) Result of ${:UVAR\(\(\(} is "VAR\(\(\(" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF) make: "varname.mk" line 32: Need an operator @ 1.6 log @make(1): document undefined behavior in Parse_IsVar Sigh. If only C could be compiled in strict mode that detects these out-of-bounds memory accesses. @ text @d12 1 a12 1 make: "varname.mk" line 29: Error in archive specification: "VAR" d17 1 a17 1 make: "varname.mk" line 30: Need an operator d21 1 a21 1 make: "varname.mk" line 31: Need an operator @ 1.5 log @make(1): fix test for parsing obscure variable names I had forgotten the :U modifier. Without that modifier, there's no chance that the variable names would come out correctly. @ text @d12 1 a12 1 make: "varname.mk" line 26: Error in archive specification: "VAR" d17 1 a17 1 make: "varname.mk" line 27: Need an operator d21 1 a21 1 make: "varname.mk" line 28: Need an operator @ 1.4 log @make(1): add tests for parsing ob obscure variable names @ text @d7 10 a16 4 Var_Parse: ${VAR(((}= try1 with VARE_UNDEFERR|VARE_WANTRES Global:.ALLTARGETS = 3 Global:.ALLTARGETS = 3 open Global:.ALLTARGETS = 3 open parentheses= d18 3 a20 2 Var_Parse: ${VAR\(\(\(}= try2 with VARE_UNDEFERR|VARE_WANTRES Global:.ALLTARGETS = 3 open parentheses= = a21 2 Var_Parse: ${VAR\(\(\(}= try3 with VARE_UNDEFERR|VARE_WANTRES make: "varname.mk" line 29: Need an operator @ 1.3 log @make(1): sort variables in debug output This way it's easier to see whether an expected variable is missing, or to compare the values of related variables, since they usually share a common prefix. Any sorting criterion is better than the hash code. Sorting the variables by name changed the order of the output in varname.mk. That test didn't test anything meaningful, it was just a playground to understand and demonstrate the current implementation of how the variables are stored, therefore it has been removed. @ text @d1 21 a21 1 exit status 0 @ 1.2 log @make(1): add expected test result for hashing variable names @ text @a0 18 MAGIC1B1B1B = 1 MAGIC1B1B0a = 2 MAGIC1B0a1B = 3 MAGIC1B0a0a = 4 MAGIC0a1B1B = 5 MAGIC0a1B0a = 6 MAGIC0a0a1B = 7 MAGIC0a0a0a = 8 ORDER_01 = yes MAGIC0a0a0a = 1 MAGIC0a0a1B = 2 MAGIC0a1B0a = 3 MAGIC0a1B1B = 4 MAGIC1B0a0a = 5 MAGIC1B0a1B = 6 MAGIC1B1B0a = 7 MAGIC1B1B1B = 8 ORDER_10 = yes @ 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 18 @