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.3 perseant-exfatfs-base-20240630:1.4 perseant-exfatfs:1.4.0.2 perseant-exfatfs-base:1.4 netbsd-10-0-RELEASE:1.3 netbsd-10-0-RC6:1.3 netbsd-10-0-RC5:1.3 netbsd-10-0-RC4:1.3 netbsd-10-0-RC3:1.3 netbsd-10-0-RC2:1.3 netbsd-10-0-RC1:1.3 netbsd-10:1.3.0.6 netbsd-10-base:1.3 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.28.22.39.28; author rillig; state Exp; branches; next 1.10; commitid CDDpACH2g2jV3I0G; 1.10 date 2025.04.04.18.57.01; author rillig; state Exp; branches; next 1.9; commitid mmmOUH7D718XyLPF; 1.9 date 2025.04.04.18.33.46; author rillig; state Exp; branches; next 1.8; commitid eGzRkJWC2rO7rLPF; 1.8 date 2025.03.30.09.51.50; author rillig; state Exp; branches; next 1.7; commitid veGmSzVhPiW2G4PF; 1.7 date 2025.01.11.21.21.33; author rillig; state Exp; branches; next 1.6; commitid NtFvbDJHnW9G17FF; 1.6 date 2025.01.10.23.00.38; author rillig; state Exp; branches; next 1.5; commitid vECOnwAU0SdlAZEF; 1.5 date 2024.08.06.18.00.17; author rillig; state Exp; branches; next 1.4; commitid 1R0ZDok3menTZMkF; 1.4 date 2023.06.01.20.56.35; author rillig; state Exp; branches 1.4.2.1; next 1.3; commitid j3tIvMRlxolKQhrE; 1.3 date 2020.11.15.14.58.14; author rillig; state Exp; branches; next 1.2; commitid cic6f0a3jiRYHZvC; 1.2 date 2020.08.20.19.43.42; author rillig; state Exp; branches; next 1.1; commitid T6BnqLaPDb5l5QkC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.4.2.1 date 2025.08.02.05.58.32; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.11 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 @make: cond-token-var.mk:23: ok make: cond-token-var.mk:30: Variable "UNDEF" is undefined make: cond-token-var.mk:36: Variable "UNDEF" is undefined make: cond-token-var.mk:46: Variable "UNDEF" is undefined make: cond-token-var.mk:64: Variable "U" is undefined make: cond-token-var.mk:69: Variable "U" is undefined make: cond-token-var.mk:78: Variable "U" is undefined Var_Parse: ${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:106: Malformed conditional "x${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3}" Var_Parse: ${DEF}y == "${UNDEF2}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:111: Malformed conditional "x${DEF}y == "${UNDEF2}" || 0x${UNDEF3}" Var_Parse: ${DEF}y == "${DEF}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:116: Malformed conditional "x${DEF}y == "${DEF}" || 0x${UNDEF3}" Global: VAR.param = value of VAR.param Var_Parse: ${VAR.param$U} (eval-defined-loud) Var_Parse: $U} (eval) Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: cond-token-var.mk:133: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" make: cond-token-var.mk:142: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" make: cond-token-var.mk:151: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.10 log @make: fix error message for undefined variable in conditional Previously, only ${UNDEF} had the proper error message, while ${UNDEF:M*} still produced the wrong "Malformed conditional". @ text @d9 1 a9 1 make: cond-token-var.mk:106: Malformed conditional 'x${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3}' d11 1 a11 1 make: cond-token-var.mk:111: Malformed conditional 'x${DEF}y == "${UNDEF2}" || 0x${UNDEF3}' d13 1 a13 1 make: cond-token-var.mk:116: Malformed conditional 'x${DEF}y == "${DEF}" || 0x${UNDEF3}' @ 1.9 log @tests/make: demonstrate wrong error message for undefined variable Found by wiz in pkgsrc/x11/gtk3. @ text @d19 6 a24 3 make: cond-token-var.mk:134: Malformed conditional '${UNDEF:M*}' make: cond-token-var.mk:144: Malformed conditional '${UNDEF:M*} != ""' make: cond-token-var.mk:154: Malformed conditional '${:U} != ${UNDEF:M*}' @ 1.8 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 @d19 3 @ 1.7 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 @d1 7 a7 7 make: "cond-token-var.mk" line 23: ok make: "cond-token-var.mk" line 30: Variable "UNDEF" is undefined make: "cond-token-var.mk" line 36: Variable "UNDEF" is undefined make: "cond-token-var.mk" line 46: Variable "UNDEF" is undefined make: "cond-token-var.mk" line 64: Variable "U" is undefined make: "cond-token-var.mk" line 69: Variable "U" is undefined make: "cond-token-var.mk" line 78: Variable "U" is undefined d9 1 a9 1 make: "cond-token-var.mk" line 106: Malformed conditional 'x${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3}' d11 1 a11 1 make: "cond-token-var.mk" line 111: Malformed conditional 'x${DEF}y == "${UNDEF2}" || 0x${UNDEF3}' d13 1 a13 1 make: "cond-token-var.mk" line 116: Malformed conditional 'x${DEF}y == "${DEF}" || 0x${UNDEF3}' @ 1.6 log @tests/make: test expressions based on undefined variables When an undefined variable is used in a conditional, make complains about "Malformed conditional", which is wrong since the conditional is well-formed but errors out during evaluation. In order to fix this wrong error message and preserve the remaining behavior, cover the places in which an expression is evaluated with undefined expressions being an error (VARE_EVAL_DEFINED), but with neither producing an error message nor handling errors. This combination results in the same behavior as evaluating the expressions in the mode that allows undefined variables to be used in expressions. @ text @d2 15 a16 12 make: "cond-token-var.mk" line 30: Malformed conditional '${UNDEF} == ${DEF}' make: "cond-token-var.mk" line 36: Malformed conditional '${DEF} == ${UNDEF}' make: "cond-token-var.mk" line 46: Malformed conditional '${UNDEF}' make: "cond-token-var.mk" line 65: Malformed conditional '$U == $D' make: "cond-token-var.mk" line 71: Malformed conditional '$D == $U' make: "cond-token-var.mk" line 81: Malformed conditional '$U' Var_Parse: ${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3} (eval-defined) make: "cond-token-var.mk" line 109: Malformed conditional 'x${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3}' Var_Parse: ${DEF}y == "${UNDEF2}" || 0x${UNDEF3} (eval-defined) make: "cond-token-var.mk" line 114: Malformed conditional 'x${DEF}y == "${UNDEF2}" || 0x${UNDEF3}' Var_Parse: ${DEF}y == "${DEF}" || 0x${UNDEF3} (eval-defined) make: "cond-token-var.mk" line 119: Malformed conditional 'x${DEF}y == "${DEF}" || 0x${UNDEF3}' @ 1.5 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 15 a15 4 make: "cond-token-var.mk" line 21: ok make: "cond-token-var.mk" line 28: Malformed conditional '${UNDEF} == ${DEF}' make: "cond-token-var.mk" line 34: Malformed conditional '${DEF} == ${UNDEF}' make: "cond-token-var.mk" line 44: Malformed conditional '${UNDEF}' @ 1.4 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 @d2 3 a4 3 make: "cond-token-var.mk" line 28: Malformed conditional (${UNDEF} == ${DEF}) make: "cond-token-var.mk" line 34: Malformed conditional (${DEF} == ${UNDEF}) make: "cond-token-var.mk" line 44: Malformed conditional (${UNDEF}) @ 1.4.2.1 log @Sync with HEAD @ text @d1 4 a4 24 make: cond-token-var.mk:23: ok make: cond-token-var.mk:30: Variable "UNDEF" is undefined make: cond-token-var.mk:36: Variable "UNDEF" is undefined make: cond-token-var.mk:46: Variable "UNDEF" is undefined make: cond-token-var.mk:64: Variable "U" is undefined make: cond-token-var.mk:69: Variable "U" is undefined make: cond-token-var.mk:78: Variable "U" is undefined Var_Parse: ${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:106: Malformed conditional "x${UNDEF1}y == "${UNDEF2}" || 0x${UNDEF3}" Var_Parse: ${DEF}y == "${UNDEF2}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:111: Malformed conditional "x${DEF}y == "${UNDEF2}" || 0x${UNDEF3}" Var_Parse: ${DEF}y == "${DEF}" || 0x${UNDEF3} (eval) make: cond-token-var.mk:116: Malformed conditional "x${DEF}y == "${DEF}" || 0x${UNDEF3}" Global: VAR.param = value of VAR.param Var_Parse: ${VAR.param$U} (eval-defined-loud) Var_Parse: $U} (eval) Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: cond-token-var.mk:133: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" make: cond-token-var.mk:142: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" make: cond-token-var.mk:151: Variable "UNDEF" is undefined while evaluating variable "UNDEF" with value "" @ 1.3 log @make(1): add remarks to the tests about conditions @ text @d1 4 a4 4 make: "cond-token-var.mk" line 20: ok make: "cond-token-var.mk" line 27: Malformed conditional (${UNDEF} == ${DEF}) make: "cond-token-var.mk" line 33: Malformed conditional (${DEF} == ${UNDEF}) make: "cond-token-var.mk" line 42: Malformed conditional (${UNDEF}) @ 1.2 log @make(1): add test for variable expressions in conditions @ text @d1 4 a4 4 make: "cond-token-var.mk" line 9: ok make: "cond-token-var.mk" line 15: Malformed conditional (${UNDEF} == ${DEF}) make: "cond-token-var.mk" line 20: Malformed conditional (${DEF} == ${UNDEF}) make: "cond-token-var.mk" line 29: Malformed conditional (${UNDEF}) @ 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 7 a7 1 exit status 0 @