From 4c2e57d4066692f4e0577cc46925cf7b76222202 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 25 Jan 2024 15:29:36 +0100 Subject: [PATCH] glibc: use __GLIBC_USE_DEPRECATED_SCANF for glibc versions < 2.7 --- lib/libc/include/generic-glibc/features.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/include/generic-glibc/features.h b/lib/libc/include/generic-glibc/features.h index c21c2e27b0a7a0ff7ddd59c49a880f7b2484448d..e0b3bdf5bfe5730f3ecb2ac95479dc114da1d4ef 100644 --- a/lib/libc/include/generic-glibc/features.h +++ b/lib/libc/include/generic-glibc/features.h @@ -469,7 +469,10 @@ instance, with GCC, -std=gnu11 will have C99-compliant scanf with or without -D_GNU_SOURCE, but -std=c89 -D_GNU_SOURCE will have the old extension. */ -#if (defined __USE_GNU \ +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) +/* support for ISOC99 was added in glibc-2.7 */ +# define __GLIBC_USE_DEPRECATED_SCANF 1 +#elif (defined __USE_GNU \ && (defined __cplusplus \ ? (__cplusplus < 201103L && !defined __GXX_EXPERIMENTAL_CXX0X__) \ : (!defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L))) -- 2.54.0