From 6b8fb74a9403092c4e4813c728e20ed10a84676f Mon Sep 17 00:00:00 2001 From: Jens Remus Date: Tue, 13 Jan 2026 14:14:43 +0100 Subject: [PATCH] gas: sframe: do not test whether offsetT exceeds INT64_MIN..INT64_MAX MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A value of type offsetT, which is either a signed 32-bit or 64-bit integer, cannot exceed the range of INT64_MIN..INT64_MAX. This resolves the following compile error: ../../binutils-gdb/gas/gen-sframe.c: In function ‘get_offset_size_in_bytes’: ../../binutils-gdb/gas/gen-sframe.c:213:45: error: comparison is always true due to limited range of data type [-Werror=type-limits] 213 | else if ((sizeof (offsetT) > 4) && (value <= INT64_MAX && value >= INT64_MIN)) | ^~ ../../binutils-gdb/gas/gen-sframe.c:213:67: error: comparison is always true due to limited range of data type [-Werror=type-limits] 213 | else if ((sizeof (offsetT) > 4) && (value <= INT64_MAX && value >= INT64_MIN)) | ^~ Fixes: 58008ed4e6af ("gas: sframe: use standard min/max integer constants") Signed-off-by: Jens Remus --- gas/gen-sframe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index b4e983957a1..bf5cd62f6fc 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -210,7 +210,7 @@ get_offset_size_in_bytes (offsetT value) size = 2; else if (value <= INT32_MAX && value >= INT32_MIN) size = 4; - else if ((sizeof (offsetT) > 4) && (value <= INT64_MAX && value >= INT64_MIN)) + else if (sizeof (offsetT) > 4) size = 8; return size; -- 2.47.3