head 1.13; access; symbols netbsd-11-0-RC4:1.13 netbsd-11-0-RC3:1.13 netbsd-11-0-RC2:1.13 netbsd-11-0-RC1:1.13 perseant-exfatfs-base-20250801:1.13 netbsd-11:1.13.0.2 netbsd-11-base:1.13 netbsd-10-1-RELEASE:1.8 perseant-exfatfs-base-20240630:1.9 perseant-exfatfs:1.9.0.2 perseant-exfatfs-base:1.9 netbsd-10-0-RELEASE:1.8 netbsd-10-0-RC6:1.8 netbsd-10-0-RC5:1.8 netbsd-10-0-RC4:1.8 netbsd-10-0-RC3:1.8 netbsd-10-0-RC2:1.8 netbsd-10-0-RC1:1.8 netbsd-10:1.8.0.2 netbsd-10-base:1.8 cjep_sun2x-base1:1.5 cjep_sun2x:1.5.0.4 cjep_sun2x-base:1.5 cjep_staticlib_x-base1:1.5 cjep_staticlib_x:1.5.0.2 cjep_staticlib_x-base:1.5; locks; strict; comment @# @; 1.13 date 2025.06.28.22.39.28; author rillig; state Exp; branches; next 1.12; commitid CDDpACH2g2jV3I0G; 1.12 date 2025.03.30.09.51.49; author rillig; state Exp; branches; next 1.11; commitid veGmSzVhPiW2G4PF; 1.11 date 2024.08.06.18.00.16; author rillig; state Exp; branches; next 1.10; commitid 1R0ZDok3menTZMkF; 1.10 date 2024.07.04.20.18.40; author rillig; state Exp; branches; next 1.9; commitid 75IS4XOhTa8VOygF; 1.9 date 2023.03.04.08.07.29; author rillig; state Exp; branches 1.9.2.1; next 1.8; commitid 19sa4fPF6fo1tMfE; 1.8 date 2022.09.04.22.55.00; author rillig; state Exp; branches; next 1.7; commitid auChYqGjKD5CbBSD; 1.7 date 2022.03.03.19.36.35; author rillig; state Exp; branches; next 1.6; commitid faQJWLUTqSno2OuD; 1.6 date 2021.07.29.06.31.18; author rillig; state Exp; branches; next 1.5; commitid ywWUGbVLu6gaDQ2D; 1.5 date 2021.01.21.23.32.28; author rillig; state Exp; branches; next 1.4; commitid LUEP2wpU10b1oEEC; 1.4 date 2021.01.21.23.25.08; author rillig; state Exp; branches; next 1.3; commitid McwjjlVUtTpNlEEC; 1.3 date 2020.11.08.22.56.16; author rillig; state Exp; branches; next 1.2; commitid qDRmedQ4A6lWz8vC; 1.2 date 2020.09.12.18.01.51; author rillig; state Exp; branches; next 1.1; commitid SQKBxI28SGFcMMnC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.9.2.1 date 2025.08.02.05.58.31; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.13 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 @CondParser_Eval: !(${:UINF} > 1e100) make: cond-cmp-numeric.mk:15: Comparison with ">" requires both operands "INF" and "1e100" to be numeric CondParser_Eval: ${:UNaN} > NaN make: cond-cmp-numeric.mk:21: Comparison with ">" requires both operands "NaN" and "NaN" to be numeric CondParser_Eval: !(${:UNaN} == NaN) Comparing "NaN" == "NaN" CondParser_Eval: 123 ! 123 make: cond-cmp-numeric.mk:38: Malformed conditional "123 ! 123" CondParser_Eval: ${:U 123} < 124 Comparing 123.000000 < 124.000000 CondParser_Eval: ${:U123 } < 124 make: cond-cmp-numeric.mk:54: Comparison with "<" requires both operands "123 " and "124" to be numeric make: Fatal errors encountered -- cannot continue make: stopped making "all" in unit-tests exit status 1 @ 1.12 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 @d2 1 a2 1 make: cond-cmp-numeric.mk:15: Comparison with '>' requires both operands 'INF' and '1e100' to be numeric d4 1 a4 1 make: cond-cmp-numeric.mk:21: Comparison with '>' requires both operands 'NaN' and 'NaN' to be numeric d8 1 a8 1 make: cond-cmp-numeric.mk:38: Malformed conditional '123 ! 123' d12 1 a12 1 make: cond-cmp-numeric.mk:54: Comparison with '<' requires both operands '123 ' and '124' to be numeric @ 1.11 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 @d2 1 a2 1 make: "cond-cmp-numeric.mk" line 15: Comparison with '>' requires both operands 'INF' and '1e100' to be numeric d4 1 a4 1 make: "cond-cmp-numeric.mk" line 21: Comparison with '>' requires both operands 'NaN' and 'NaN' to be numeric d8 1 a8 1 make: "cond-cmp-numeric.mk" line 38: Malformed conditional '123 ! 123' d12 1 a12 1 make: "cond-cmp-numeric.mk" line 54: Comparison with '<' requires both operands '123 ' and '124' to be numeric @ 1.10 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: "cond-cmp-numeric.mk" line 38: Malformed conditional (123 ! 123) @ 1.9 log @tests/make: test very small and very large numbers in conditions @ text @d14 1 a14 1 make: stopped in unit-tests @ 1.9.2.1 log @Sync with HEAD @ text @d2 1 a2 1 make: cond-cmp-numeric.mk:15: Comparison with ">" requires both operands "INF" and "1e100" to be numeric d4 1 a4 1 make: cond-cmp-numeric.mk:21: Comparison with ">" requires both operands "NaN" and "NaN" to be numeric d8 1 a8 1 make: cond-cmp-numeric.mk:38: Malformed conditional "123 ! 123" d12 1 a12 1 make: cond-cmp-numeric.mk:54: Comparison with "<" requires both operands "123 " and "124" to be numeric d14 1 a14 1 make: stopped making "all" in unit-tests @ 1.8 log @make: add more details to error message for numeric comparison Before: String comparison operator must be either == or != After: Comparison with '>=' requires both operands 'no' and '10' to be numeric Noticed by martin@@ in pkgsrc/textproc/py-pygments. @ text @d2 1 a2 1 make: "cond-cmp-numeric.mk" line 11: Comparison with '>' requires both operands 'INF' and '1e100' to be numeric d4 1 a4 1 make: "cond-cmp-numeric.mk" line 16: Comparison with '>' requires both operands 'NaN' and 'NaN' to be numeric d8 1 a8 1 make: "cond-cmp-numeric.mk" line 34: Malformed conditional (123 ! 123) d12 1 a12 1 make: "cond-cmp-numeric.mk" line 50: Comparison with '<' requires both operands '123 ' and '124' to be numeric @ 1.7 log @make: make debug logging for comparisons less technical @ text @d2 1 a2 1 make: "cond-cmp-numeric.mk" line 11: String comparison operator must be either == or != d4 1 a4 1 make: "cond-cmp-numeric.mk" line 16: String comparison operator must be either == or != d12 1 a12 1 make: "cond-cmp-numeric.mk" line 50: String comparison operator must be either == or != @ 1.6 log @tests/make: test spaces around numbers in comparisons Just to see whether it is possible to write a conditional in the form ${ ${A} < ${B} :? ${A} : ${B} }, that is, with leading and trailing whitespace, to make it easier for humans to read the code. It's not possible, the result of this computation cannot be used in further numeric comparisons, at least not in .if directives. Leading space would work, but trailing space wouldn't. On the other hand, they would work in expressions of the form ${ ${A} < ${B} :? ... : ... } since in these, the condition is first expanded and then parsed. But that is an implementation detail that is not documented and it is also difficult to understand. @ text @d6 1 a6 1 lhs = "NaN", rhs = "NaN", op = == d10 1 a10 1 lhs = 123.000000, rhs = 124.000000, op = < @ 1.5 log @make(1): replace warning + error with just an error in conditionals Before, there was a "warning" for comparing strings using '<', which was wrong. That warning was then followed by an error, after parsing the whole conditional. This was only because it was easier to implement. Replace the warning with an actual error. This only affects conditionals in .if lines, the conditionals in the :? modifier such as ${"A" < "B":?smaller:greater} still print 2 errors. @ text @d9 4 @ 1.4 log @make(1): fix debug output for comparison operators in conditionals This produces fewer warnings than before, but these were edge cases that probably didn't matter in practice. The "Malformaed conditional" is still generated, the set of accepted conditionals is still the same. @ text @d2 1 a2 2 make: "cond-cmp-numeric.mk" line 11: warning: String comparison operator must be either == or != make: "cond-cmp-numeric.mk" line 11: Malformed conditional (!(${:UINF} > 1e100)) d4 1 a4 2 make: "cond-cmp-numeric.mk" line 16: warning: String comparison operator must be either == or != make: "cond-cmp-numeric.mk" line 16: Malformed conditional (${:UNaN} > NaN) @ 1.3 log @make(1): add test for wrong comparison operator in conditional @ text @a9 2 lhs = 123.000000, rhs = 123.000000, op = ! make: "cond-cmp-numeric.mk" line 34: warning: Unknown operator @ 1.2 log @make(1): add test for Infinity and NaN Neither is recognized by the make parser, which is good since the main task of make is dependency resolution and text processing, not calculating. @ text @d9 4 @ 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 11 a11 1 exit status 0 @