Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 2025 09:34:44 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bd953a6026fc - main - libutil: Fix 32-bit build
Message-ID:  <202508070934.5779Yi7Y084721@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=bd953a6026fce63b0a76a01da1812e51f630f797

commit bd953a6026fce63b0a76a01da1812e51f630f797
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-08-07 09:31:25 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-08-07 09:34:13 +0000

    libutil: Fix 32-bit build
    
    In the expand_generic test case for expand_number(), leave out size_t
    if it's not 64 bits wide.
    
    Fixes:          ab1c6874e500
---
 lib/libutil/tests/expand_number_test.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/libutil/tests/expand_number_test.c b/lib/libutil/tests/expand_number_test.c
index 8ff56e1ed01f..9bd339298575 100644
--- a/lib/libutil/tests/expand_number_test.c
+++ b/lib/libutil/tests/expand_number_test.c
@@ -251,7 +251,9 @@ ATF_TC_BODY(expand_generic, tp)
 {
 	uint64_t uint64;
 	int64_t int64;
+#ifdef __LP64__
 	size_t size;
+#endif
 	off_t off;
 
 	ATF_REQUIRE_EQ(0, expand_number("18446744073709551615", &uint64));
@@ -266,10 +268,12 @@ ATF_TC_BODY(expand_generic, tp)
 	ATF_REQUIRE_EQ(0, expand_number("-9223372036854775808", &int64));
 	ATF_REQUIRE_EQ(INT64_MIN, int64);
 
+#ifdef __LP64__
 	ATF_REQUIRE_EQ(0, expand_number("18446744073709551615", &size));
 	ATF_REQUIRE_EQ(UINT64_MAX, size);
 	ATF_REQUIRE_EQ(-1, expand_number("-1", &size));
 	ATF_REQUIRE_EQ(ERANGE, errno);
+#endif
 
 	ATF_REQUIRE_EQ(0, expand_number("9223372036854775807", &off));
 	ATF_REQUIRE_EQ(INT64_MAX, off);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202508070934.5779Yi7Y084721>