fstests: Address -Wsign-compare warnings

This warning occurs when comparing a signed variable to an unsigned one.
This is frequently an int or ssize_t variable compared to a uint32_t or
size_t. Sometimes the size_t is from a sizeof() use.
This commit is contained in:
Joel Sherrill
2026-01-28 10:48:42 -06:00
committed by Gedare Bloom
parent dd4670e83d
commit 55d18c302e
3 changed files with 6 additions and 6 deletions

View File

@@ -107,7 +107,7 @@ static void write_to_file( const char *file, bool sync )
rtems_test_assert( n == (ssize_t) sizeof( buf ) );
pos_after = lseek( fd, 0, SEEK_END );
rtems_test_assert( pos_after == pos_before + sizeof( buf ) );
rtems_test_assert( pos_after == pos_before + (ssize_t) sizeof( buf ) );
if ( sync ) {
rv = fsync( fd );

View File

@@ -612,7 +612,7 @@ block_rw_lseek (int fd, size_t pos)
off_t actual;
actual = lseek (fd, pos, SEEK_SET);
rtems_test_assert (actual == pos);
rtems_test_assert (actual == (off_t) pos);
}
static void
@@ -648,7 +648,7 @@ block_rw_check (int fd, const char *out, char *in, size_t size)
off_t file_size;
file_size = lseek (fd, 0, SEEK_END);
rtems_test_assert (file_size == size);
rtems_test_assert (file_size == (off_t) size);
block_rw_lseek (fd, 0);

View File

@@ -81,7 +81,7 @@ static void symlink_test01(void )
status=lstat(symlink_file01,&statbuf);
rtems_test_assert(status==0);
rtems_test_assert(S_ISLNK(statbuf.st_mode));
rtems_test_assert(len==statbuf.st_size);
rtems_test_assert((off_t)len==statbuf.st_size);
puts("call readlink ");
@@ -99,7 +99,7 @@ static void symlink_test01(void )
status=lstat(symlink_file01,&statbuf);
rtems_test_assert(status==0);
rtems_test_assert(S_ISLNK(statbuf.st_mode));
rtems_test_assert(len==statbuf.st_size);
rtems_test_assert((off_t)len==statbuf.st_size);
puts("call readlink ");
name_len=readlink(symlink_file01,name,sizeof(name)-1);
@@ -119,7 +119,7 @@ static void symlink_test01(void )
status=lstat(symlink_file01,&statbuf);
rtems_test_assert(status==0);
rtems_test_assert(S_ISLNK(statbuf.st_mode));
rtems_test_assert(len==statbuf.st_size);
rtems_test_assert((off_t)len==statbuf.st_size);
puts("call readlink ");