From bcb814451c8a9649e892e7cb5c954ae2b08518a4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 4 Feb 2026 09:21:55 -0600 Subject: [PATCH] bsps/sparc: 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. --- bsps/sparc/erc32/console/erc32_console.c | 2 +- bsps/sparc/leon2/console/console.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bsps/sparc/erc32/console/erc32_console.c b/bsps/sparc/erc32/console/erc32_console.c index 7aeb739677..01c5c70afb 100644 --- a/bsps/sparc/erc32/console/erc32_console.c +++ b/bsps/sparc/erc32/console/erc32_console.c @@ -292,7 +292,7 @@ static ssize_t erc32_console_write_support_polled( size_t len ) { - int nwrite = 0; + size_t nwrite = 0; while (nwrite < len) { console_outbyte_polled( minor, *buf++ ); diff --git a/bsps/sparc/leon2/console/console.c b/bsps/sparc/leon2/console/console.c index 56298504ee..d4492e070c 100644 --- a/bsps/sparc/leon2/console/console.c +++ b/bsps/sparc/leon2/console/console.c @@ -283,7 +283,7 @@ void console_outbyte_interrupt( static ssize_t console_write_support (int minor, const char *buf, size_t len) { - int nwrite = 0; + size_t nwrite = 0; while (nwrite < len) { #if (CONSOLE_USE_INTERRUPTS)