From 80365c94a7d8273953f867107786eb75cb2e7933 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 30 Jan 2026 09:18:58 -0600 Subject: [PATCH] cpukit/libdl: 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. --- cpukit/libdl/rtl-archive.c | 2 +- cpukit/libdl/rtl-obj-cache.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpukit/libdl/rtl-archive.c b/cpukit/libdl/rtl-archive.c index e85f659b29..0e79a86b89 100644 --- a/cpukit/libdl/rtl-archive.c +++ b/cpukit/libdl/rtl-archive.c @@ -1134,7 +1134,7 @@ rtems_rtl_obj_archive_find_obj (int fd, *osize = 0; } - while (*ooffset < fsize) + while (*ooffset < (int64_t)fsize) { /* * Clean up any existing data. diff --git a/cpukit/libdl/rtl-obj-cache.c b/cpukit/libdl/rtl-obj-cache.c index 837fd330eb..9329b2ecd4 100644 --- a/cpukit/libdl/rtl-obj-cache.c +++ b/cpukit/libdl/rtl-obj-cache.c @@ -115,7 +115,7 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache, if (cache->fd == fd) { - if (offset >= cache->file_size) + if (offset >= (int64_t)cache->file_size) { rtems_rtl_set_error (EINVAL, "offset past end of file: offset=%i size=%i", (int) offset, (int) cache->file_size); @@ -154,7 +154,7 @@ rtems_rtl_obj_cache_read (rtems_rtl_obj_cache* cache, * Is any part of the data in the cache ? */ if ((offset >= cache->offset) && - (offset < (cache->offset + cache->level))) + (offset < (int64_t)(cache->offset + cache->level))) { size_t size;