1 # $NetBSD: cond-cmp-numeric.mk,v 1.4 2020/11/08 22:56:16 rillig Exp $
3 # Tests for numeric comparisons in .if conditions.
7 # The ${:U...} on the left-hand side is necessary for the parser.
9 # Even if strtod(3) parses "INF" as +Infinity, make does not accept this
10 # since it is not really a number; see TryParseNumber.
11 .if !(${:UINF} > 1e100)
15 # Neither is NaN a number; see TryParseNumber.
20 # Since NaN is not parsed as a number, both operands are interpreted
21 # as strings and are therefore equal. If they were parsed as numbers,
22 # they would compare unequal, since NaN is unequal to any and everything,
24 .if !(${:UNaN} == NaN)
28 # The parsing code in CondParser_Comparison only performs a light check on
29 # whether the operator is valid, leaving the rest of the work to the
30 # evaluation functions EvalCompareNum and EvalCompareStr. Ensure that this
31 # parse error is properly reported.
33 # XXX: The warning message does not mention the actual operator.