commit e997cb43bb38636bd3df72ec96e066879dec7852
parent 87128815ed757d2949707fb99cf3ba421f5986dc
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 30 Mar 2026 12:09:05 -0700
tests/cc: Fix type of constant in 0253-maxconst.c
If a decimal integer constant has no suffix, its type is the first
of [int, long int, long long int] that can represent it[0]. The
value 18446744073709551615 (2^64 - 1) cannot be represented in any
of those types. Instead, use 18446744073709551615u, which can be
represented as `unsigned long long int`.
[0] See C99 6.4.4.1p5
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cc/execute/0253-maxconst.c b/tests/cc/execute/0253-maxconst.c
@@ -3,5 +3,5 @@ main(void)
{
unsigned long long u = 18446744073709551615ull;
- return !(u == 18446744073709551615);
+ return !(u == 18446744073709551615u);
}