From ec5d809fa22fd7d0fd715da1c2cbb058ec46bae8 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 3 Feb 2026 16:40:48 -0600 Subject: [PATCH] fstests/fsrdwr: Address -Wsign-compare warnings This warning occurs when comparing a signed variable to an unsigned one. This addresses warnings that only occurred on 64-bit targets. For the ones which only appeared on 64-bit targets, the cause was frequently a mismatch when comparing a combination off_t, ssize_t, and int. --- testsuites/fstests/fsrdwr/init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testsuites/fstests/fsrdwr/init.c b/testsuites/fstests/fsrdwr/init.c index 1c884cf9d3..6e112e34b2 100644 --- a/testsuites/fstests/fsrdwr/init.c +++ b/testsuites/fstests/fsrdwr/init.c @@ -56,7 +56,7 @@ static const char databuf[] = "4Happy days are here again.5Happy days are here again.6Happy days are here " "again.7Happy days are here again."; -static const size_t len = sizeof( databuf ) - 1; +static const ssize_t len = sizeof( databuf ) - 1; static void test_case_enter( const char *wd ) { @@ -229,10 +229,9 @@ static void truncate_test03( void ) int status; char *name01 = "name01"; struct stat statbuf; - - char data; - int n; - size_t i; + char data; + int n; + ssize_t i; char *readbuf; off_t good_size = 100;