From dd4670e83d7de02746b7d3fb97493f0f0669e6f2 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 28 Jan 2026 10:44:39 -0600 Subject: [PATCH] cpukit/libfs/rfs: 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 addresses sign comparison warnings in the RFS. --- cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c index efedc657c1..9cca40dfb6 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c @@ -443,7 +443,7 @@ rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control, if (!rtems_rfs_bitmap_match (*search_bits, RTEMS_RFS_BITMAP_ELEMENT_SET)) { while ((search_offset >= 0) - && (search_offset < rtems_rfs_bitmap_element_bits ())) + && ((size_t) search_offset < rtems_rfs_bitmap_element_bits ())) { if (!rtems_rfs_bitmap_test (*search_bits, search_offset)) { @@ -452,7 +452,7 @@ rtems_rfs_search_map_for_clear_bit (rtems_rfs_bitmap_control* control, * found. We may find none are spare if searching up from the seed. */ while ((map_offset >= 0) - && (map_offset < rtems_rfs_bitmap_element_bits ())) + && ((size_t) map_offset < rtems_rfs_bitmap_element_bits ())) { if (!rtems_rfs_bitmap_test (*map_bits, map_offset)) {