summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Mehnert <frank.mehnert@kernkonzept.com>2025-01-06 08:21:29 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2025-01-06 10:15:05 +0100
commit34f10c209db28c136e6ed6bc5f001785558f2863 (patch)
treeec8681a57127beb6970ce37eb43c8b813fe4ee57
parentaf63ee93ed565c3c8228e5e1eeb48f750c86d750 (diff)
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
-rw-r--r--libc/stdio/_scanf.c2
1 files changed, 1 insertions, 1 deletions
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__