From 34f10c209db28c136e6ed6bc5f001785558f2863 Mon Sep 17 00:00:00 2001
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
Date: Mon, 6 Jan 2025 08:21:29 +0100
Subject: uclibc: prevent warning about setting an unused variable

This variable is used either if __UCLIBC_HAS_FLOATS__ is defined or if
__UCLIBC_HAS_GLIBC_DIGIT_GROUPING__ is defined. Instead of adding more
complicated #ifdef magic, just mark this variable as possibly unused to
satisfy the compiler.

Signed-off-by: marcus.haehnel@kernkonzept.com
---
 libc/stdio/_scanf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'libc')

diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c
index 3f3000d6f..cb72d14ac 100644
--- a/libc/stdio/_scanf.c
+++ b/libc/stdio/_scanf.c
@@ -1715,7 +1715,7 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
 #define MAX_DIGITS 65			/* Allow one leading 0. */
 	unsigned char buf[MAX_DIGITS+2+ 100];
 	unsigned char usflag, base;
-	unsigned char nonzero = 0;
+	unsigned char nonzero __attribute__((unused)) = 0;
 	unsigned char seendigit = 0;
 
 #ifndef __UCLIBC_HAS_FLOATS__
-- 
cgit v1.2.3