From patchwork Sun Nov 9 21:52:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123837 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01C4D3858419 for ; Sun, 9 Nov 2025 21:56:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01C4D3858419 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=FEdByKeT X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 38C673858D33 for ; Sun, 9 Nov 2025 21:52:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38C673858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 38C673858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725170; cv=none; b=QyLONnINoR3I8TVsdBwPO4muMG6MkRsbXPJ6COjGQE6keeAqJHL6lC9tJStEmkZ3kwBkQj+VirptJf0KmUm9DThUi75X4eJBD/ruwkuLZHyyar7oChsKZ36spE6tvdglaFw8wgSk+MYpVW9JFCfGKfpynYn8TXyo0aCb2Q/uT2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725170; c=relaxed/simple; bh=1baRHDIaiAJ7CWn/jWLHAnRr0aKDFTR2RNp9+afjAqI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=u/kDpsjzsMfAUrH3NyyxihH0vVmPylvrN62tyzRDk89sykoY+PZezsMf8NUiCYX0MvOGsgQrNnnqapBPQoc8kVCMnW5yPvl1VzzeMJaioLoijGc2EFnSiAlyuD2G6zJXZjbag0IscCsj41RW2Z2fnmD1AHJZrm8ixIFSSAYlddQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38C673858D33 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 7EB5760008 for ; Sun, 9 Nov 2025 21:52:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41CD8C4AF10; Sun, 9 Nov 2025 21:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725169; bh=1baRHDIaiAJ7CWn/jWLHAnRr0aKDFTR2RNp9+afjAqI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FEdByKeTZGdGhvE3Hy71YGuf1hPRW0NCs2GLE9YOROIJxvUhVIVYEAlKIDNY7gK3z Op7dUpZ/DFjuoI2ESICL4QiX2SKodSFNybtTH1WrquCsdcdCR5BlDPCDA7cws4xJ/0 XGy09l/8w3IfVbdJePE82Zd1rkGF2Aj1mrywKvzy/1n8JhnlPl0OW0GIWmiNC0V+B2 KwWMoUindpkbnmHRiSQe4nOoHv0a6J1/r7kkeauRcGzzbbPKWnbo+TwSQaFByQeiIT b9fyurL64x6nlwy1IO9D2Dp9v+iF7rCqofjfPAcdkl6zX3bYqlMWf/ywGaE/sy9RYV zvoYXxRDKeGGQ== Date: Sun, 9 Nov 2025 22:52:46 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 01/35] Assume __GNUC__ Message-ID: <11778c7d54de374739526b723ab0529294c29ef9.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- argp/argp-help.c | 17 --- assert/assert.h | 2 +- ctype/test_ctype.c | 2 - include/alloca.h | 2 - include/features.h | 2 +- include/intprops.h | 4 - include/limits.h | 6 +- inet/netinet/in.h | 39 ------- intl/dcigettext.c | 23 +--- intl/gettextP.h | 4 - intl/localealias.c | 21 +--- intl/plural-exp.c | 2 +- intl/plural.y | 9 -- io/ftw.c | 12 --- libio/bits/stdio.h | 2 +- libio/oldstdfiles.c | 2 +- libio/stdio.h | 4 - libio/tst-freopen.c | 4 +- libio/tst-wmemstream1.c | 4 +- libio/tst-wmemstream5.c | 4 +- locale/programs/charmap-kw.h | 6 -- locale/programs/locfile-kw.h | 6 -- malloc/obstack.h | 101 ------------------ math/math.h | 4 +- misc/sys/cdefs.h | 53 +-------- misc/sys/param.h | 4 - misc/sys/select.h | 2 +- posix/regcomp.c | 2 +- posix/regex.h | 6 +- signal/signal.h | 6 -- soft-fp/soft-fp.h | 6 +- stdio-common/vfscanf-internal.c | 4 - stdlib/alloca.h | 2 - stdlib/gmp-impl.h | 12 +-- stdlib/gmp.h | 14 +-- stdlib/longlong.h | 4 +- stdlib/putenv.c | 8 -- stdlib/setenv.c | 3 +- stdlib/tst-realpath.c | 4 +- string/string.h | 2 +- sysdeps/alpha/bits/mathdef.h | 2 +- sysdeps/mach/hurd/x86/sys/io.h | 2 +- sysdeps/mips/__longjmp.c | 4 - sysdeps/mips/mips64/__longjmp.c | 4 - sysdeps/nptl/pthread.h | 2 +- sysdeps/sh/fpu_control.h | 4 - sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 2 +- sysdeps/unix/sysv/linux/x86/sys/io.h | 2 +- time/strftime_l.c | 2 - time/strptime_l.c | 2 +- timezone/private.h | 2 +- wcsmbs/wchar.h | 4 - 52 files changed, 46 insertions(+), 400 deletions(-) diff --git a/argp/argp-help.c b/argp/argp-help.c index 3fe3a244ce..b8749b1f32 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -25,21 +25,6 @@ #include #endif -/* AIX requires this to be the first thing in the file. */ -#ifndef __GNUC__ -# if HAVE_ALLOCA_H || defined _LIBC -# include -# else -# ifdef _AIX -#pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - #include #include #include @@ -1825,9 +1810,7 @@ __argp_short_program_name (void) /* FIXME: What now? Miles suggests that it is better to use NULL, but currently the value is passed on directly to fputs_unlocked, so that requires more changes. */ -# if __GNUC__ # warning No reasonable value to return -# endif /* __GNUC__ */ return ""; # endif } diff --git a/assert/assert.h b/assert/assert.h index 31892aebcb..273bf7f35c 100644 --- a/assert/assert.h +++ b/assert/assert.h @@ -101,7 +101,7 @@ __END_DECLS ? void (0) \ : __assert_fail (#expr, __ASSERT_FILE, __ASSERT_LINE, \ __ASSERT_FUNCTION)) -# elif !defined __GNUC__ || defined __STRICT_ANSI__ +# elif defined __STRICT_ANSI__ # define assert(expr) \ ((expr) \ ? __ASSERT_VOID_CAST (0) \ diff --git a/ctype/test_ctype.c b/ctype/test_ctype.c index 7efaf97537..d9bb009fc5 100644 --- a/ctype/test_ctype.c +++ b/ctype/test_ctype.c @@ -24,9 +24,7 @@ #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e,f) (((e) && !(f)) || (!(e) && (f))) -#ifdef __GNUC__ __inline -#endif static void print_char (unsigned char c) { diff --git a/include/alloca.h b/include/alloca.h index 5f2df32b46..3268302b10 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -11,9 +11,7 @@ /* Now define the internal interfaces. */ extern void *__alloca (size_t __size); -#ifdef __GNUC__ # define __alloca(size) __builtin_alloca (size) -#endif /* GCC. */ extern int __libc_use_alloca (size_t size) __attribute__ ((const)); extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const)); diff --git a/include/features.h b/include/features.h index 673c4036cd..877d4c7aa8 100644 --- a/include/features.h +++ b/include/features.h @@ -169,7 +169,7 @@ #endif Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was added in 2.0. */ -#if defined __GNUC__ && defined __GNUC_MINOR__ +#if defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else diff --git a/include/intprops.h b/include/intprops.h index 140e51054a..126d661156 100644 --- a/include/intprops.h +++ b/include/intprops.h @@ -421,11 +421,7 @@ For now, assume all versions of GCC-like compilers generate bogus warnings for _Generic. This matters only for compilers that lack relevant builtins. */ -#if __GNUC__ || defined __clang__ # define _GL__GENERIC_BOGUS 1 -#else -# define _GL__GENERIC_BOGUS 0 -#endif /* Store the low-order bits of A B into *R, where OP specifies the operation and OVERFLOW the overflow predicate. Return 1 if the diff --git a/include/limits.h b/include/limits.h index 6370ccd84d..905849b736 100644 --- a/include/limits.h +++ b/include/limits.h @@ -34,7 +34,7 @@ /* If we are not using GNU CC we have to define all the symbols ourself. Otherwise use gcc's definitions (see below). */ -#if !defined __GNUC__ || __GNUC__ < 2 +#if __GNUC__ < 2 /* We only protect from multiple inclusion here, because all the other #include's protect themselves, and in GCC 2 we may #include_next through @@ -119,7 +119,7 @@ We put this #include_next outside the double inclusion check because it should be possible to include this file more than once and still get the definitions from gcc's header. */ -#if defined __GNUC__ && !defined _GCC_LIMITS_H_ +#if !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ # include_next #endif @@ -127,7 +127,7 @@ /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ -#if defined __USE_ISOC99 && defined __GNUC__ +#if defined __USE_ISOC99 # ifndef LLONG_MIN # define LLONG_MIN (-LLONG_MAX-1) # endif diff --git a/inet/netinet/in.h b/inet/netinet/in.h index fa796be406..d9bb33115a 100644 --- a/inet/netinet/in.h +++ b/inet/netinet/in.h @@ -433,7 +433,6 @@ extern uint16_t htons (uint16_t __hostshort) # endif #endif -#ifdef __GNUC__ # define IN6_IS_ADDR_UNSPECIFIED(a) \ (__extension__ \ ({ const struct in6_addr *__a = (const struct in6_addr *) (a); \ @@ -483,44 +482,6 @@ extern uint16_t htons (uint16_t __hostshort) && __a->__in6_u.__u6_addr32[1] == __b->__in6_u.__u6_addr32[1] \ && __a->__in6_u.__u6_addr32[2] == __b->__in6_u.__u6_addr32[2] \ && __a->__in6_u.__u6_addr32[3] == __b->__in6_u.__u6_addr32[3]; })) -#else -# define IN6_IS_ADDR_UNSPECIFIED(a) \ - (((const uint32_t *) (a))[0] == 0 \ - && ((const uint32_t *) (a))[1] == 0 \ - && ((const uint32_t *) (a))[2] == 0 \ - && ((const uint32_t *) (a))[3] == 0) - -# define IN6_IS_ADDR_LOOPBACK(a) \ - (((const uint32_t *) (a))[0] == 0 \ - && ((const uint32_t *) (a))[1] == 0 \ - && ((const uint32_t *) (a))[2] == 0 \ - && ((const uint32_t *) (a))[3] == htonl (1)) - -# define IN6_IS_ADDR_LINKLOCAL(a) \ - ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ - == htonl (0xfe800000)) - -# define IN6_IS_ADDR_SITELOCAL(a) \ - ((((const uint32_t *) (a))[0] & htonl (0xffc00000)) \ - == htonl (0xfec00000)) - -# define IN6_IS_ADDR_V4MAPPED(a) \ - ((((const uint32_t *) (a))[0] == 0) \ - && (((const uint32_t *) (a))[1] == 0) \ - && (((const uint32_t *) (a))[2] == htonl (0xffff))) - -# define IN6_IS_ADDR_V4COMPAT(a) \ - ((((const uint32_t *) (a))[0] == 0) \ - && (((const uint32_t *) (a))[1] == 0) \ - && (((const uint32_t *) (a))[2] == 0) \ - && (ntohl (((const uint32_t *) (a))[3]) > 1)) - -# define IN6_ARE_ADDR_EQUAL(a,b) \ - ((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) \ - && (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) \ - && (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) \ - && (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3])) -#endif #define IN6_IS_ADDR_MULTICAST(a) (((const uint8_t *) (a))[0] == 0xff) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 60fa3d73fe..cb33a589a1 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -27,27 +27,8 @@ #include -#ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca -char *alloca (); -# endif -# endif -# endif -# endif -#endif #include #ifndef errno @@ -114,7 +95,7 @@ extern int errno; #endif /* Alignment of types. */ -#if defined __GNUC__ && __GNUC__ >= 2 +#if __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ @@ -180,7 +161,7 @@ static void *mempcpy (void *dest, const void *src, size_t n); /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ -#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) +#if defined _POSIX_VERSION # include #endif diff --git a/intl/gettextP.h b/intl/gettextP.h index cad851782b..869d25051e 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -197,11 +197,7 @@ struct loaded_domain /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ -#ifdef __GNUC__ # define ZERO 0 -#else -# define ZERO 1 -#endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ diff --git a/intl/localealias.c b/intl/localealias.c index e75adbae78..0c90597480 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -32,28 +32,9 @@ #endif #include -#ifdef __GNUC__ # undef alloca # define alloca __builtin_alloca # define HAVE_ALLOCA 1 -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca -char *alloca (); -# endif -# endif -# endif -# endif -#endif #include #include @@ -316,7 +297,7 @@ read_alias_file (const char *fname, int fname_len) { #pragma GCC diagnostic push -#if defined __GNUC__ && __GNUC__ >= 12 +#if __GNUC__ >= 12 /* Suppress the valid GCC 12 warning until the code below is changed to avoid using pointers to the reallocated block. */ # pragma GCC diagnostic ignored "-Wuse-after-free" diff --git a/intl/plural-exp.c b/intl/plural-exp.c index 42a6b04954..f14d5bfcaa 100644 --- a/intl/plural-exp.c +++ b/intl/plural-exp.c @@ -25,7 +25,7 @@ #include -#if (defined __GNUC__ && !(defined __APPLE_CC_ && __APPLE_CC__ > 1) && \ +#if (!(defined __APPLE_CC_ && __APPLE_CC__ > 1) && \ !defined __cplusplus) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) diff --git a/intl/plural.y b/intl/plural.y index a56bead594..8762f67a4d 100644 --- a/intl/plural.y +++ b/intl/plural.y @@ -16,15 +16,6 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -/* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us - to put this declaration at the beginning of the file. The declaration in - bison's skeleton file comes too late. This must come before - because may include arbitrary system headers. - This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */ -#if defined _AIX && !defined __GNUC__ - #pragma alloca -#endif - #ifdef HAVE_CONFIG_H # include #endif diff --git a/io/ftw.c b/io/ftw.c index dce2e67f72..4a23e768cb 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -20,19 +20,7 @@ # include #endif -#if __GNUC__ # define alloca __builtin_alloca -#else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - # pragma alloca -# else -char *alloca (); -# endif -# endif -#endif #ifdef _LIBC # include diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h index 731f3936c0..3c6445b3bf 100644 --- a/libio/bits/stdio.h +++ b/libio/bits/stdio.h @@ -141,7 +141,7 @@ __NTH (ferror_unlocked (FILE *__stream)) #endif /* Use extern inlines. */ -#if defined __USE_MISC && defined __GNUC__ && defined __OPTIMIZE__ \ +#if defined __USE_MISC && defined __OPTIMIZE__ \ && !defined __cplusplus /* Perform some simple optimizations. */ # define fread_unlocked(ptr, size, n, stream) \ diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c index b47ce955d7..250bf9e616 100644 --- a/libio/oldstdfiles.c +++ b/libio/oldstdfiles.c @@ -52,7 +52,7 @@ compat_symbol (libc, _IO_stdin_, _IO_stdin_, GLIBC_2_0); compat_symbol (libc, _IO_stdout_, _IO_stdout_, GLIBC_2_0); compat_symbol (libc, _IO_stderr_, _IO_stderr_, GLIBC_2_0); -#if defined __GNUC__ && __GNUC__ >= 2 +#if __GNUC__ >= 2 #include diff --git a/libio/stdio.h b/libio/stdio.h index e0e70945fa..49859a1d8d 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -48,14 +48,10 @@ __BEGIN_DECLS #endif #if defined __USE_XOPEN || defined __USE_XOPEN2K8 -# ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef __gnuc_va_list va_list; # define _VA_LIST_DEFINED # endif -# else -# include -# endif #endif #if defined __USE_UNIX98 || defined __USE_XOPEN2K diff --git a/libio/tst-freopen.c b/libio/tst-freopen.c index 788b8776e1..d502141af4 100644 --- a/libio/tst-freopen.c +++ b/libio/tst-freopen.c @@ -84,7 +84,7 @@ do_test_basic (void) fclose (f); } -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Force an error to detect incorrectly making freopen a deallocator for its last argument via attribute malloc. The function closes the stream without deallocating it so either the argument or @@ -115,7 +115,7 @@ do_test_return_stream (void) fclose (f1); } -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Pop -Wmismatched-dealloc set to error above. */ # pragma GCC diagnostic pop #endif diff --git a/libio/tst-wmemstream1.c b/libio/tst-wmemstream1.c index f80655b2a4..f890306b0a 100644 --- a/libio/tst-wmemstream1.c +++ b/libio/tst-wmemstream1.c @@ -2,7 +2,7 @@ extern int fclose (FILE*); -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Verify that calling fclose on the result of open_wmemstream doesn't trigger GCC -Wmismatched-dealloc with fclose forward-declared and without included first (it is included later, in. @@ -30,7 +30,7 @@ int test_open_wmemstream_no_stdio (void) return 0; } -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Restore -Wmismatched-dealloc setting. */ # pragma GCC diagnostic pop #endif diff --git a/libio/tst-wmemstream5.c b/libio/tst-wmemstream5.c index c43f8d1e72..a5a4a59cf0 100644 --- a/libio/tst-wmemstream5.c +++ b/libio/tst-wmemstream5.c @@ -19,7 +19,7 @@ extern int fclose (FILE*); -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Verify that calling fclose on the result of open_wmemstream doesn't trigger GCC -Wmismatched-dealloc with fclose forward-declared and without included in the same translation unit. */ @@ -48,7 +48,7 @@ do_test (void) return 0; } -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Restore -Wmismatched-dealloc setting. */ # pragma GCC diagnostic pop #endif diff --git a/locale/programs/charmap-kw.h b/locale/programs/charmap-kw.h index 505b364d88..6943620644 100644 --- a/locale/programs/charmap-kw.h +++ b/locale/programs/charmap-kw.h @@ -60,13 +60,7 @@ struct keyword_t ; #define MAX_HASH_VALUE 35 /* maximum key range = 33, duplicates = 0 */ -#ifdef __GNUC__ __inline -#else -#ifdef __cplusplus -inline -#endif -#endif static unsigned int hash (register const char *str, register size_t len) { diff --git a/locale/programs/locfile-kw.h b/locale/programs/locfile-kw.h index 9460a43ab1..1dc23b52c7 100644 --- a/locale/programs/locfile-kw.h +++ b/locale/programs/locfile-kw.h @@ -60,13 +60,7 @@ struct keyword_t ; #define MAX_HASH_VALUE 630 /* maximum key range = 628, duplicates = 0 */ -#ifdef __GNUC__ __inline -#else -#ifdef __cplusplus -inline -#endif -#endif static unsigned int hash (register const char *str, register size_t len) { diff --git a/malloc/obstack.h b/malloc/obstack.h index 7e3dee21c8..43457353c3 100644 --- a/malloc/obstack.h +++ b/malloc/obstack.h @@ -257,7 +257,6 @@ extern int obstack_exit_failure; #define obstack_memory_used(h) _obstack_memory_used (h) -#if defined __GNUC__ # if ! (2 < __GNUC__ + (8 <= __GNUC_MINOR__)) # define __extension__ # endif @@ -408,106 +407,6 @@ extern int obstack_exit_failure; __o->next_free = __o->object_base = (char *) __obj; \ else (__obstack_free) (__o, __obj); }) -#else /* not __GNUC__ */ - -# define obstack_object_size(h) \ - (unsigned) ((h)->next_free - (h)->object_base) - -# define obstack_room(h) \ - (unsigned) ((h)->chunk_limit - (h)->next_free) - -# define obstack_empty_p(h) \ - ((h)->chunk->prev == 0 \ - && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk, \ - (h)->chunk->contents, \ - (h)->alignment_mask)) - -/* Note that the call to _obstack_newchunk is enclosed in (..., 0) - so that we can avoid having void expressions - in the arms of the conditional expression. - Casting the third operand to void was tried before, - but some compilers won't accept it. */ - -# define obstack_make_room(h, length) \ - ((h)->temp.tempint = (length), \ - (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0)) - -# define obstack_grow(h, where, length) \ - ((h)->temp.tempint = (length), \ - (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ - memcpy ((h)->next_free, where, (h)->temp.tempint), \ - (h)->next_free += (h)->temp.tempint) - -# define obstack_grow0(h, where, length) \ - ((h)->temp.tempint = (length), \ - (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ - memcpy ((h)->next_free, where, (h)->temp.tempint), \ - (h)->next_free += (h)->temp.tempint, \ - *((h)->next_free)++ = 0) - -# define obstack_1grow(h, datum) \ - ((((h)->next_free + 1 > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), 1), 0) : 0), \ - obstack_1grow_fast (h, datum)) - -# define obstack_ptr_grow(h, datum) \ - ((((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ - obstack_ptr_grow_fast (h, datum)) - -# define obstack_int_grow(h, datum) \ - ((((h)->next_free + sizeof (int) > (h)->chunk_limit) \ - ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ - obstack_int_grow_fast (h, datum)) - -# define obstack_ptr_grow_fast(h, aptr) \ - (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr)) - -# define obstack_int_grow_fast(h, aint) \ - (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint)) - -# define obstack_blank(h, length) \ - ((h)->temp.tempint = (length), \ - (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint) \ - ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ - obstack_blank_fast (h, (h)->temp.tempint)) - -# define obstack_alloc(h, length) \ - (obstack_blank ((h), (length)), obstack_finish ((h))) - -# define obstack_copy(h, where, length) \ - (obstack_grow ((h), (where), (length)), obstack_finish ((h))) - -# define obstack_copy0(h, where, length) \ - (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) - -# define obstack_finish(h) \ - (((h)->next_free == (h)->object_base \ - ? (((h)->maybe_empty_object = 1), 0) \ - : 0), \ - (h)->temp.tempptr = (h)->object_base, \ - (h)->next_free \ - = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ - (h)->alignment_mask), \ - (((h)->next_free - (char *) (h)->chunk \ - > (h)->chunk_limit - (char *) (h)->chunk) \ - ? ((h)->next_free = (h)->chunk_limit) : 0), \ - (h)->object_base = (h)->next_free, \ - (h)->temp.tempptr) - -# define obstack_free(h, obj) \ - ((h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk, \ - ((((h)->temp.tempint > 0 \ - && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ - ? (void) ((h)->next_free = (h)->object_base \ - = (h)->temp.tempint + (char *) (h)->chunk) \ - : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk))) - -#endif /* not __GNUC__ */ - #ifdef __cplusplus } /* C++ */ #endif diff --git a/math/math.h b/math/math.h index b0d99cff8e..a51edc59a6 100644 --- a/math/math.h +++ b/math/math.h @@ -26,7 +26,7 @@ #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include -#if defined log && defined __GNUC__ +#if defined log # warning A macro called log was already defined when was included. # warning This will cause compilation problems. #endif @@ -1316,7 +1316,7 @@ iszero (__T __val) /* Return X == Y but raising "invalid" and setting errno if X or Y is a NaN. */ -# if !defined __cplusplus || (__cplusplus < 201103L && !defined __GNUC__) +# if !defined __cplusplus # define iseqsig(x, y) \ __MATH_TG (__MATH_EVAL_FMT2 (x, y), __iseqsig, ((x), (y))) # else diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 215ff937ee..a4ae665d8a 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -27,7 +27,7 @@ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not supported anymore. */ -#if defined __GNUC__ && !defined __STDC__ && !defined __cplusplus +#if !defined __STDC__ && !defined __cplusplus # error "You need a ISO C or C++ conforming compiler to use the glibc headers" #endif @@ -57,8 +57,6 @@ # define __glibc_has_extension(ext) 0 #endif -#if defined __GNUC__ || defined __clang__ - /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ # if __GNUC_PREREQ (4, 6) && !defined _LIBC @@ -104,22 +102,6 @@ # define __COLD # endif -#else /* Not GCC or clang. */ - -# if (defined __cplusplus \ - || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) -# define __inline inline -# else -# define __inline /* No inline functions. */ -# endif - -# define __THROW -# define __THROWNL -# define __NTH(fct) fct -# define __COLD - -#endif /* GCC || clang. */ - /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ #define __P(args) args @@ -383,15 +365,11 @@ even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#elif defined __GNUC__ +#else /* Pre-2.97 GCC did not support C99 flexible arrays but did have an equivalent extension with slightly different notation. */ # define __flexarr [0] # define __glibc_c99_flexarr_available 1 -#else -/* Some other non-C99 compiler. Approximate with [1]. */ -# define __flexarr [1] -# define __glibc_c99_flexarr_available 0 #endif @@ -405,7 +383,7 @@ Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) +#if (__GNUC__ >= 2) || (__clang_major__ >= 4) # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus @@ -438,13 +416,6 @@ */ #endif -/* GCC and clang have various useful declarations that can be made with - the '__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !(defined __GNUC__ || defined __clang__) -# define __attribute__(xyz) /* Ignore */ -#endif - /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ @@ -665,16 +636,7 @@ #if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus # define __restrict_arr __restrict #else -# ifdef __GNUC__ # define __restrict_arr /* Not supported in old GCC. */ -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __restrict_arr restrict -# else -/* Some other non-C99 compiler. */ -# define __restrict_arr /* Not supported. */ -# endif -# endif #endif #if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect) @@ -814,15 +776,10 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf /* Generic selection (ISO C11) is a C-only feature, available in GCC since version 4.9. Previous versions do not provide generic selection, even though they might set __STDC_VERSION__ to 201112L, - when in -std=c11 mode. Thus, we must check for !defined __GNUC__ - when testing __STDC_VERSION__ for generic selection support. - On the other hand, Clang also defines __GNUC__, so a clang-specific - check is required to enable the use of generic selection. */ + when in -std=c11 mode. */ #if !defined __cplusplus \ && (__GNUC_PREREQ (4, 9) \ - || __glibc_has_extension (c_generic_selections) \ - || (!defined __GNUC__ && defined __STDC_VERSION__ \ - && __STDC_VERSION__ >= 201112L)) + || __glibc_has_extension (c_generic_selections)) # define __HAVE_GENERIC_SELECTION 1 #else # define __HAVE_GENERIC_SELECTION 0 diff --git a/misc/sys/param.h b/misc/sys/param.h index 5e7402b3ed..81b3c29b7d 100644 --- a/misc/sys/param.h +++ b/misc/sys/param.h @@ -89,13 +89,9 @@ #ifndef howmany # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif -#ifdef __GNUC__ # define roundup(x, y) (__builtin_constant_p (y) && powerof2 (y) \ ? (((x) + (y) - 1) & ~((y) - 1)) \ : ((((x) + ((y) - 1)) / (y)) * (y))) -#else -# define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) -#endif #define powerof2(x) ((((x) - 1) & (x)) == 0) /* Macros for min/max. */ diff --git a/misc/sys/select.h b/misc/sys/select.h index d2cdc0f1cd..a90aa00f5b 100644 --- a/misc/sys/select.h +++ b/misc/sys/select.h @@ -146,7 +146,7 @@ extern int __REDIRECT (pselect, /* Define some inlines helping to catch common problems. */ -#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ +#if __USE_FORTIFY_LEVEL > 0 # include #endif diff --git a/posix/regcomp.c b/posix/regcomp.c index f7278bb852..dbacaddb06 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -558,7 +558,7 @@ weak_alias (__regerror, regerror) static const bitset_t utf8_sb_map = { /* Set the first 128 bits. */ -# if (defined __GNUC__ || __clang_major__ >= 4) && !defined __STRICT_ANSI__ +# if !defined __STRICT_ANSI__ [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX # else # if 4 * BITSET_WORD_BITS < ASCII_CHARS diff --git a/posix/regex.h b/posix/regex.h index 67a3aa70a5..a7b66a2bfb 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -531,7 +531,7 @@ typedef struct # endif #endif -#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wvla" #endif @@ -539,7 +539,7 @@ typedef struct #ifndef _Attr_access_ # ifdef __attr_access # define _Attr_access_(arg) __attr_access (arg) -# elif defined __GNUC__ && 10 <= __GNUC__ +# elif 10 <= __GNUC__ # define _Attr_access_(x) __attribute__ ((__access__ x)) # else # define _Attr_access_(x) @@ -692,7 +692,7 @@ extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, extern void regfree (regex_t *__preg); -#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic pop #endif diff --git a/signal/signal.h b/signal/signal.h index 413b4fd23f..8c20f68199 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -147,14 +147,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); __THROW. */ #ifdef __USE_XOPEN_EXTENDED -# ifdef __GNUC__ extern int sigpause (int __sig) __asm__ ("__xpg_sigpause") __attribute_deprecated_msg__ ("Use the sigsuspend function instead"); -# else -extern int __sigpause (int __sig_or_mask, int __is_sig); -/* Remove a signal from the signal mask and suspend the process. */ -# define sigpause(sig) __sigpause ((sig), 1) -# endif #endif diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index 1f08714831..3b8d7e2265 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -49,15 +49,13 @@ /* For unreachable default cases in switch statements over bitwise OR of FP_CLS_* values. */ -#if (defined __GNUC__ \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))) +#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) # define _FP_UNREACHABLE __builtin_unreachable () #else # define _FP_UNREACHABLE abort () #endif -#if ((defined __GNUC__ \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) \ +#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define _FP_STATIC_ASSERT(expr, msg) \ _Static_assert ((expr), msg) diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c index c6361f74e0..48d974ef7d 100644 --- a/stdio-common/vfscanf-internal.c +++ b/stdio-common/vfscanf-internal.c @@ -33,12 +33,8 @@ #include #include -#ifdef __GNUC__ # define HAVE_LONGLONG # define LONGLONG long long -#else -# define LONGLONG long -#endif /* Determine whether we have to handle `long long' at all. */ #if LONG_MAX == LONG_LONG_MAX diff --git a/stdlib/alloca.h b/stdlib/alloca.h index ec36f825ad..4d7dd8cc14 100644 --- a/stdlib/alloca.h +++ b/stdlib/alloca.h @@ -31,9 +31,7 @@ __BEGIN_DECLS /* Allocate a block that will be freed when the calling function exits. */ extern void *alloca (size_t __size) __THROW; -#ifdef __GNUC__ # define alloca(size) __builtin_alloca (size) -#endif /* GCC. */ __END_DECLS diff --git a/stdlib/gmp-impl.h b/stdlib/gmp-impl.h index dea739c44c..24366b78dd 100644 --- a/stdlib/gmp-impl.h +++ b/stdlib/gmp-impl.h @@ -19,7 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see . */ /* When using gcc, make sure to use its builtin alloca. */ -#if ! defined (alloca) && defined (__GNUC__) +#if ! defined (alloca) #define alloca __builtin_alloca #define HAVE_ALLOCA #endif @@ -61,10 +61,6 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see #define NULL ((void *) 0) #endif -#if ! defined (__GNUC__) -#define inline /* Empty */ -#endif - /* Get MAX/MIN macros. */ #include @@ -275,18 +271,12 @@ extern mp_size_t __gmp_default_fp_limb_precision; (q) = _xh - q1; \ } while (0) -#if defined (__GNUC__) /* Define stuff for longlong.h. */ typedef unsigned int UQItype __attribute__ ((mode (QI))); typedef int SItype __attribute__ ((mode (SI))); typedef unsigned int USItype __attribute__ ((mode (SI))); typedef int DItype __attribute__ ((mode (DI))); typedef unsigned int UDItype __attribute__ ((mode (DI))); -#else -typedef unsigned char UQItype; -typedef long SItype; -typedef unsigned long USItype; -#endif typedef mp_limb_t UWtype; typedef unsigned int UHWtype; diff --git a/stdlib/gmp.h b/stdlib/gmp.h index 6791332af3..77665ced9d 100644 --- a/stdlib/gmp.h +++ b/stdlib/gmp.h @@ -34,18 +34,10 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see #define __gmp_const #endif -#if defined (__GNUC__) #define __gmp_inline __inline__ -#else -#define __gmp_inline -#endif #ifndef _EXTERN_INLINE -#ifdef __GNUC__ #define _EXTERN_INLINE __extern_inline -#else -#define _EXTERN_INLINE static -#endif #endif #ifdef _LIBC @@ -432,7 +424,6 @@ mp_limb_t mpn_submul_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)) _ATTRI } #endif -#if defined (__GNUC__) || defined (_FORCE_INLINES) _EXTERN_INLINE mp_limb_t #if defined (__STDC__) || defined (__cplusplus) mpn_add_1 (register mp_ptr res_ptr, @@ -574,7 +565,6 @@ mpn_sub (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size) cy_limb); return cy_limb; } -#endif /* __GNUC__ */ /* Allow faster testing for negative, zero, and positive. */ #define mpz_sgn(Z) ((Z)->_mp_size < 0 ? -1 : (Z)->_mp_size > 0) @@ -585,8 +575,7 @@ mpn_sub (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size) #define mpq_numref(Q) (&((Q)->_mp_num)) #define mpq_denref(Q) (&((Q)->_mp_den)) -/* When using GCC, optimize certain common comparisons. */ -#if defined (__GNUC__) +/* Optimize certain common comparisons. */ #define mpz_cmp_ui(Z,UI) \ (__builtin_constant_p (UI) && (UI) == 0 \ ? mpz_sgn (Z) : mpz_cmp_ui (Z,UI)) @@ -597,7 +586,6 @@ mpn_sub (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size) #define mpq_cmp_ui(Q,NUI,DUI) \ (__builtin_constant_p (NUI) && (NUI) == 0 \ ? mpq_sgn (Q) : mpq_cmp_ui (Q,NUI,DUI)) -#endif #define mpn_divmod(qp,np,nsize,dp,dsize) mpn_divrem (qp,0,np,nsize,dp,dsize) #if 0 diff --git a/stdlib/longlong.h b/stdlib/longlong.h index 4549f0a55f..49a78c9596 100644 --- a/stdlib/longlong.h +++ b/stdlib/longlong.h @@ -110,7 +110,7 @@ extern const UQItype __clz_tab[256] attribute_hidden; for the CPUs below! (E.g. WE32100, IBM360.) */ -#if defined (__GNUC__) && !defined (NO_ASM) +#if !defined (NO_ASM) /* We sometimes need to clobber "cc" with gcc2, but that would not be understood by gcc1. Use cpp to avoid major code duplication. */ @@ -1618,7 +1618,7 @@ extern UHItype __stormy16_count_leading_zeros (UHItype); } while (0) #endif /* __z8000__ */ -#endif /* __GNUC__ */ +#endif /* NO_ASM */ /* If this machine has no inline assembler, use C macros. */ diff --git a/stdlib/putenv.c b/stdlib/putenv.c index af88e2f6bc..f3124371f4 100644 --- a/stdlib/putenv.c +++ b/stdlib/putenv.c @@ -15,10 +15,6 @@ License along with the GNU C Library; if not, see . */ -#if defined _AIX && !defined __GNUC__ - #pragma alloca -#endif - #if HAVE_CONFIG_H # include #endif @@ -38,11 +34,7 @@ # ifdef HAVE_ALLOCA_H # include # else -# ifdef __GNUC__ # define alloca __builtin_alloca -# else -extern char *alloca (); -# endif /* __GNUC__ */ # endif /* HAVE_ALLOCA_H */ #endif /* _LIBC */ diff --git a/stdlib/setenv.c b/stdlib/setenv.c index 2b8b6cafa0..0f325c5a20 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -70,8 +70,7 @@ __libc_lock_define_initialized (static, envlock) allow arbitrarily many changes of the environment given that the used values are from a small set. Outside glibc this will eat up all memory after a while. */ -#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \ - && defined __GNUC__) +#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH) # define USE_TSEARCH 1 # include diff --git a/stdlib/tst-realpath.c b/stdlib/tst-realpath.c index 36b7382b7d..1cc27c06ed 100644 --- a/stdlib/tst-realpath.c +++ b/stdlib/tst-realpath.c @@ -29,7 +29,7 @@ #include #include -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Turn GCC -Wmismatched-dealloc warnings into errors to expose false positives. */ # pragma GCC diagnostic push @@ -78,7 +78,7 @@ do_test (void) return 0; } -#if defined __GNUC__ && __GNUC__ >= 11 +#if __GNUC__ >= 11 /* Restore -Wmismatched-dealloc setting. */ # pragma GCC diagnostic pop #endif diff --git a/string/string.h b/string/string.h index 81f0b7fd21..7c30580437 100644 --- a/string/string.h +++ b/string/string.h @@ -203,7 +203,7 @@ extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif -#if defined __USE_GNU && defined __GNUC__ +#if defined __USE_GNU /* Duplicate S, returning an identical alloca'd string. */ # define strdupa(s) \ (__extension__ \ diff --git a/sysdeps/alpha/bits/mathdef.h b/sysdeps/alpha/bits/mathdef.h index 8154384afb..b24fed2eed 100644 --- a/sysdeps/alpha/bits/mathdef.h +++ b/sysdeps/alpha/bits/mathdef.h @@ -21,7 +21,7 @@ #if defined _COMPLEX_H && !defined _COMPLEX_H_MATHDEF # define _COMPLEX_H_MATHDEF 1 -# if defined(__GNUC__) && !__GNUC_PREREQ(3,4) +# if !__GNUC_PREREQ(3,4) /* Due to an ABI change, we need to remap the complex float symbols. */ # define _Mdouble_ float diff --git a/sysdeps/mach/hurd/x86/sys/io.h b/sysdeps/mach/hurd/x86/sys/io.h index d250fb49ad..24e0ecf7df 100644 --- a/sysdeps/mach/hurd/x86/sys/io.h +++ b/sysdeps/mach/hurd/x86/sys/io.h @@ -34,7 +34,7 @@ extern int ioperm (unsigned long int __from, unsigned long int __num, privileges. */ extern int iopl (int __level) __THROW; -#if defined __GNUC__ && __GNUC__ >= 2 +#if __GNUC__ >= 2 static __inline unsigned char inb (unsigned short int port) diff --git a/sysdeps/mips/__longjmp.c b/sysdeps/mips/__longjmp.c index 0d4523cdf7..37aad6236d 100644 --- a/sysdeps/mips/__longjmp.c +++ b/sysdeps/mips/__longjmp.c @@ -18,10 +18,6 @@ #include #include -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - static void __attribute__ ((nomips16)) ____longjmp (__jmp_buf env_arg, int val_arg) { diff --git a/sysdeps/mips/mips64/__longjmp.c b/sysdeps/mips/mips64/__longjmp.c index 358e666f18..4e916865e9 100644 --- a/sysdeps/mips/mips64/__longjmp.c +++ b/sysdeps/mips/mips64/__longjmp.c @@ -19,10 +19,6 @@ #include #include -#ifndef __GNUC__ - #error This file uses GNU C extensions; you must compile with GCC. -#endif - void __longjmp (__jmp_buf env_arg, int val_arg) { diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index 92957a620d..ff12875723 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -562,7 +562,7 @@ struct __pthread_cleanup_frame int __cancel_type; }; -#if defined __GNUC__ && defined __EXCEPTIONS +#if defined __EXCEPTIONS # ifdef __cplusplus /* Class to handle cancellation handler invocation. */ class __pthread_cleanup_class diff --git a/sysdeps/sh/fpu_control.h b/sysdeps/sh/fpu_control.h index 6bfd82cc51..89d9c7e0e7 100644 --- a/sysdeps/sh/fpu_control.h +++ b/sysdeps/sh/fpu_control.h @@ -56,15 +56,11 @@ typedef unsigned int fpu_control_t; /* Macros for accessing the hardware control word. */ #define _FPU_GETCW(cw) __asm__ ("sts fpscr,%0" : "=r" (cw)) -#if defined __GNUC__ __BEGIN_DECLS /* GCC provides this function. */ extern void __set_fpscr (unsigned long); #define _FPU_SETCW(cw) __set_fpscr ((cw)) -#else -#define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw)) -#endif /* Default control word set at startup. */ extern fpu_control_t __fpu_control; diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 2bbf72f71d..3ad7986ba6 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -57,7 +57,7 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } -#if defined __GNUC__ && __GNUC__ <= 2 +#if __GNUC__ <= 2 /* Compatibility with g++ 2.95.x. */ #define __SSIZE_T_TYPE __SWORD_TYPE #else diff --git a/sysdeps/unix/sysv/linux/x86/sys/io.h b/sysdeps/unix/sysv/linux/x86/sys/io.h index d29f0fb221..af65e556b2 100644 --- a/sysdeps/unix/sysv/linux/x86/sys/io.h +++ b/sysdeps/unix/sysv/linux/x86/sys/io.h @@ -37,7 +37,7 @@ extern int ioperm (unsigned long int __from, unsigned long int __num, privileges. */ extern int iopl (int __level) __THROW; -#if defined __GNUC__ && __GNUC__ >= 2 +#if __GNUC__ >= 2 static __inline unsigned char inb (unsigned short int __port) diff --git a/time/strftime_l.c b/time/strftime_l.c index 5cb5f5d213..3602aa58b6 100644 --- a/time/strftime_l.c +++ b/time/strftime_l.c @@ -382,9 +382,7 @@ tm_diff (const struct tm *a, const struct tm *b) #define ISO_WEEK1_WDAY 4 /* Thursday */ #define YDAY_MINIMUM (-366) static int iso_week_days (int, int) __THROW; -#ifdef __GNUC__ __inline__ -#endif static int iso_week_days (int yday, int wday) { diff --git a/time/strptime_l.c b/time/strptime_l.c index f5e2f4f5d1..988ee0b655 100644 --- a/time/strptime_l.c +++ b/time/strptime_l.c @@ -56,7 +56,7 @@ localtime_r (const time_t *t, struct tm *tp) #define match_char(ch1, ch2) if (ch1 != ch2) return NULL -#if defined __GNUC__ && __GNUC__ >= 2 +#if __GNUC__ >= 2 # define match_string(cs1, s2) \ ({ size_t len = strlen (cs1); \ int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \ diff --git a/timezone/private.h b/timezone/private.h index c33041049f..278cf25a0b 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -78,7 +78,7 @@ # endif #endif /* _Generic is buggy in pre-4.9 GCC. */ -#if !defined HAVE__GENERIC && defined __GNUC__ && !defined __STRICT_ANSI__ +#if !defined HAVE__GENERIC && !defined __STRICT_ANSI__ # define HAVE__GENERIC (4 < __GNUC__ + (9 <= __GNUC_MINOR__)) #endif #ifndef HAVE__GENERIC diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index b31ca2d241..5155556f97 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -38,14 +38,10 @@ #include #if defined __USE_XOPEN2K || defined __USE_XOPEN2K8 -# ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef __gnuc_va_list va_list; # define _VA_LIST_DEFINED # endif -# else -# include -# endif #endif #include From patchwork Sun Nov 9 21:52:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123836 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98CCD3858C52 for ; Sun, 9 Nov 2025 21:56:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98CCD3858C52 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ABtkiwxu X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id D7B3F3858C56 for ; Sun, 9 Nov 2025 21:52:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7B3F3858C56 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7B3F3858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725173; cv=none; b=FFIKedhSlqfRmJWysKDxFEvXsgDl4XJnEhcrqTy3EhkG0JGXOGeq8mzBZxdDxEN2NfkziPwPbpTgIUyzmkQz9itHRSxEJurhAuEKzbCPA7JZU+HxOk5x1RTC31tGADWhQeKduDeIDvgya2X0LFosRJQXCzfyiJ5tjGTt/EEg/5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725173; c=relaxed/simple; bh=BsPawCB6R+oafKIXUsYoSEfg0LTDPFP9fEKQCumg5CQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=SXPPKn7uIjbdw58S6AlED3G6ykbaugYM4Y2LT7rn+t+K+iVF8C8YoOxzrzx8ihk+F9HOKptLaeng2GxjQeSL9Ot3MOe9SKTlM2yzlxfC3FDpXOpaxZCSjF0XLeIIcHxo1n1+2rXhIfCSDF94TaoNwKO2Ij1QEeTSyfQuO9iYRv0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7B3F3858C56 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id F3587444FC for ; Sun, 9 Nov 2025 21:52:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32E90C4CEFB; Sun, 9 Nov 2025 21:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725171; bh=BsPawCB6R+oafKIXUsYoSEfg0LTDPFP9fEKQCumg5CQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ABtkiwxuqGS6Dd+YYa/55kSqImEfa1NFeswellg6WjbGBTPbeJU3jSBg6XPDNeqqh lynYgUOxAS1mJNJFjxXCNELcUU3VOcAsOtC33LwWeJQxMSJdaG/DJjTeQGj1bOnWuC HTiIl46yMm16p4ZxnhzvOoMpSb4XZ5e5qyr9CdeiJ1FPS7+UdezxSwTjCMLa4RYweg qh2QQeb0SiYBny3V20LaXdtSsJ6zYowPenyPfL21ppI7u6FhN/RnHAOItbM2L00NsQ HMByVEzYsXa8vCLHKdR6ivwcAg+e8AQx/KfSTUr6naO3lYcZ+gzoA13Sz4QOk55cZF 1UvMcU7ZZO5oA== Date: Sun, 9 Nov 2025 22:52:49 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 02/35] Assume __GNUC__ >= 2 Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- ctype/ctype.h | 4 +- include/limits.h | 80 ---------------------------- intl/dcigettext.c | 5 -- libio/oldstdfiles.c | 4 -- misc/sys/cdefs.h | 10 ---- posix/regex_internal.h | 2 +- stdlib/longlong.h | 9 +--- sysdeps/generic/machine-gmon.h | 6 +-- sysdeps/mach/hurd/x86/sys/io.h | 4 -- sysdeps/unix/sysv/linux/x86/sys/io.h | 4 -- time/strptime_l.c | 6 --- 11 files changed, 6 insertions(+), 128 deletions(-) diff --git a/ctype/ctype.h b/ctype/ctype.h index 3864c90617..0da70c8d96 100644 --- a/ctype/ctype.h +++ b/ctype/ctype.h @@ -216,7 +216,7 @@ __NTH (toupper (int __c)) } # endif -# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus +# if defined __OPTIMIZE__ && !defined __cplusplus # define tolower(c) __tobody (c, tolower, *__ctype_tolower_loc (), (c)) # define toupper(c) __tobody (c, toupper, *__ctype_toupper_loc (), (c)) # endif /* Optimizing gcc */ @@ -271,7 +271,7 @@ extern int tolower_l (int __c, locale_t __l) __THROW; extern int __toupper_l (int __c, locale_t __l) __THROW; extern int toupper_l (int __c, locale_t __l) __THROW; -# if __GNUC__ >= 2 && defined __OPTIMIZE__ && !defined __cplusplus +# if defined __OPTIMIZE__ && !defined __cplusplus # define __tolower_l(c, locale) \ __tobody (c, __tolower_l, (locale)->__ctype_tolower, (c, locale)) # define __toupper_l(c, locale) \ diff --git a/include/limits.h b/include/limits.h index 905849b736..6d69c86f08 100644 --- a/include/limits.h +++ b/include/limits.h @@ -32,86 +32,6 @@ #define MB_LEN_MAX 16 -/* If we are not using GNU CC we have to define all the symbols ourself. - Otherwise use gcc's definitions (see below). */ -#if __GNUC__ < 2 - -/* We only protect from multiple inclusion here, because all the other - #include's protect themselves, and in GCC 2 we may #include_next through - multiple copies of this file before we get to GCC's. */ -# ifndef _LIMITS_H -# define _LIMITS_H 1 - -#include - -/* We don't have #include_next. - Define ANSI for standard 32-bit words. */ - -/* These assume 8-bit `char's, 16-bit `short int's, - and 32-bit `int's and `long int's. */ - -/* Number of bits in a `char'. */ -# define CHAR_BIT 8 - -/* Minimum and maximum values a `signed char' can hold. */ -# define SCHAR_MIN (-128) -# define SCHAR_MAX 127 - -/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */ -# define UCHAR_MAX 255 - -/* Minimum and maximum values a `char' can hold. */ -# ifdef __CHAR_UNSIGNED__ -# define CHAR_MIN 0 -# define CHAR_MAX UCHAR_MAX -# else -# define CHAR_MIN SCHAR_MIN -# define CHAR_MAX SCHAR_MAX -# endif - -/* Minimum and maximum values a `signed short int' can hold. */ -# define SHRT_MIN (-32768) -# define SHRT_MAX 32767 - -/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */ -# define USHRT_MAX 65535 - -/* Minimum and maximum values a `signed int' can hold. */ -# define INT_MIN (-INT_MAX - 1) -# define INT_MAX 2147483647 - -/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */ -# define UINT_MAX 4294967295U - -/* Minimum and maximum values a `signed long int' can hold. */ -# if __WORDSIZE == 64 -# define LONG_MAX 9223372036854775807L -# else -# define LONG_MAX 2147483647L -# endif -# define LONG_MIN (-LONG_MAX - 1L) - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */ -# if __WORDSIZE == 64 -# define ULONG_MAX 18446744073709551615UL -# else -# define ULONG_MAX 4294967295UL -# endif - -# ifdef __USE_ISOC99 - -/* Minimum and maximum values a `signed long long int' can hold. */ -# define LLONG_MAX 9223372036854775807LL -# define LLONG_MIN (-LLONG_MAX - 1LL) - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ -# define ULLONG_MAX 18446744073709551615ULL - -# endif /* ISO C99 */ - -# endif /* limits.h */ -#endif /* GCC 2. */ - #endif /* !_LIBC_LIMITS_H_ */ /* Get the compiler's limits.h, which defines almost all the ISO constants. diff --git a/intl/dcigettext.c b/intl/dcigettext.c index cb33a589a1..fe5c19bf37 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -95,12 +95,7 @@ extern int errno; #endif /* Alignment of types. */ -#if __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) -#else -# define alignof(TYPE) \ - ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) -#endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c index 250bf9e616..af793413ba 100644 --- a/libio/oldstdfiles.c +++ b/libio/oldstdfiles.c @@ -52,8 +52,6 @@ compat_symbol (libc, _IO_stdin_, _IO_stdin_, GLIBC_2_0); compat_symbol (libc, _IO_stdout_, _IO_stdout_, GLIBC_2_0); compat_symbol (libc, _IO_stderr_, _IO_stderr_, GLIBC_2_0); -#if __GNUC__ >= 2 - #include extern const int _IO_stdin_used; @@ -96,5 +94,3 @@ _IO_check_libio (void) } #endif - -#endif diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index a4ae665d8a..71e2ec92d5 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -383,8 +383,6 @@ Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#if (__GNUC__ >= 2) || (__clang_major__ >= 4) - # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus # define __REDIRECT_NTH(name, proto, alias) \ @@ -408,14 +406,6 @@ #define __REDIRECT_FORTIFY_NTH __REDIRECT_NTH #endif -/* -#elif __SOME_OTHER_COMPILER__ - -# define __REDIRECT(name, proto, alias) name proto; \ - _Pragma("let " #name " = " #alias) -*/ -#endif - /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ diff --git a/posix/regex_internal.h b/posix/regex_internal.h index 722da1b7d2..34c7c32764 100644 --- a/posix/regex_internal.h +++ b/posix/regex_internal.h @@ -347,7 +347,7 @@ typedef struct Idx idx; /* for BACK_REF */ re_context_type ctx_type; /* for ANCHOR */ } opr; -#if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ re_token_type_t type : 8; #else re_token_type_t type; diff --git a/stdlib/longlong.h b/stdlib/longlong.h index 49a78c9596..0be2159111 100644 --- a/stdlib/longlong.h +++ b/stdlib/longlong.h @@ -112,15 +112,10 @@ extern const UQItype __clz_tab[256] attribute_hidden; #if !defined (NO_ASM) -/* We sometimes need to clobber "cc" with gcc2, but that would not be - understood by gcc1. Use cpp to avoid major code duplication. */ -#if __GNUC__ < 2 -#define __CLOBBER_CC -#define __AND_CLOBBER_CC -#else /* __GNUC__ >= 2 */ +/* We sometimes need to clobber "cc". + Use cpp to avoid major code duplication. */ #define __CLOBBER_CC : "cc" #define __AND_CLOBBER_CC , "cc" -#endif /* __GNUC__ < 2 */ #if defined (__aarch64__) diff --git a/sysdeps/generic/machine-gmon.h b/sysdeps/generic/machine-gmon.h index 20babbbaf5..e4a6528f47 100644 --- a/sysdeps/generic/machine-gmon.h +++ b/sysdeps/generic/machine-gmon.h @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -/* GCC version 2 gives us a perfect magical function to get +/* GCC gives us a perfect magical function to get just the information we need: void *__builtin_return_address (unsigned int N) returns the return address of the frame N frames up. */ @@ -25,10 +25,6 @@ for N != 0 on all machines. In this case, you may have to write your own version of _mcount(). */ -#if __GNUC__ < 2 - #error "This file uses __builtin_return_address, a GCC 2 extension." -#endif - #include /* The canonical name for the function is `_mcount' in both C and asm, but some old asm code might assume it's `mcount'. */ diff --git a/sysdeps/mach/hurd/x86/sys/io.h b/sysdeps/mach/hurd/x86/sys/io.h index 24e0ecf7df..1dd5b324b5 100644 --- a/sysdeps/mach/hurd/x86/sys/io.h +++ b/sysdeps/mach/hurd/x86/sys/io.h @@ -34,8 +34,6 @@ extern int ioperm (unsigned long int __from, unsigned long int __num, privileges. */ extern int iopl (int __level) __THROW; -#if __GNUC__ >= 2 - static __inline unsigned char inb (unsigned short int port) { @@ -171,7 +169,5 @@ outsl (unsigned short int port, const void *addr, unsigned long int count) "=c" (count):"d" (port), "0" (addr), "1" (count)); } -#endif /* GNU C */ - __END_DECLS #endif /* _SYS_IO_H */ diff --git a/sysdeps/unix/sysv/linux/x86/sys/io.h b/sysdeps/unix/sysv/linux/x86/sys/io.h index af65e556b2..b9eda87faf 100644 --- a/sysdeps/unix/sysv/linux/x86/sys/io.h +++ b/sysdeps/unix/sysv/linux/x86/sys/io.h @@ -37,8 +37,6 @@ extern int ioperm (unsigned long int __from, unsigned long int __num, privileges. */ extern int iopl (int __level) __THROW; -#if __GNUC__ >= 2 - static __inline unsigned char inb (unsigned short int __port) { @@ -177,7 +175,5 @@ outsl (unsigned short int __port, const void *__addr, :"d" (__port), "0" (__addr), "1" (__count)); } -#endif /* GNU C */ - __END_DECLS #endif /* _SYS_IO_H */ diff --git a/time/strptime_l.c b/time/strptime_l.c index 988ee0b655..ab5d4447bd 100644 --- a/time/strptime_l.c +++ b/time/strptime_l.c @@ -56,17 +56,11 @@ localtime_r (const time_t *t, struct tm *tp) #define match_char(ch1, ch2) if (ch1 != ch2) return NULL -#if __GNUC__ >= 2 # define match_string(cs1, s2) \ ({ size_t len = strlen (cs1); \ int result = __strncasecmp_l ((cs1), (s2), len, locale) == 0; \ if (result) (s2) += len; \ result; }) -#else -/* Oh come on. Get a reasonable compiler. */ -# define match_string(cs1, s2) \ - (strncasecmp ((cs1), (s2), strlen (cs1)) ? 0 : ((s2) += strlen (cs1), 1)) -#endif /* We intentionally do not use isdigit() for testing because this will lead to problems with the wide character version. */ #define get_number(from, to, n) \ From patchwork Sun Nov 9 21:52:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123838 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 13EA53858419 for ; Sun, 9 Nov 2025 21:57:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13EA53858419 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=KJaH3JeL X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 351623858408 for ; Sun, 9 Nov 2025 21:52:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 351623858408 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 351623858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725175; cv=none; b=oFZv4GSEDKYSRyC5zAOLMM6Wz+i3Gr3td3vIZhzRuFnVGWUnrlOTHSSZg4SdhUZnY5VF27kg9zr91hg0H4xlEboTOBRSLKwtKbC1TZYknIffPqBUFv1n0Xn98titNilz+rSl2dewaHMtnVNaZt/O5JZpAqHNrAfj6JZQ2Qgoido= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725175; c=relaxed/simple; bh=ryk34h/G9BAPCwHlcB95FoxIIHczOzmgJ4vb7Fe+rLw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=gY7M8Y8QmxOW4YyYG2bGgwx5nhPCBvzdZFCbg/5Pa4/w0QJKrQCRMIBrneSC5JgXDBsQXPk9n/OK0fWw+KWjdvOXZweIrP4ojwMXSX/Yc0lvAP1pRjWyfkEp/Bveh2GKoxDOXTMZYC/qyttV8EC72/puBGLvigYKc7CKjC57RE8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 351623858408 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 977EF43711 for ; Sun, 9 Nov 2025 21:52:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7EC2C4CEF7; Sun, 9 Nov 2025 21:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725174; bh=ryk34h/G9BAPCwHlcB95FoxIIHczOzmgJ4vb7Fe+rLw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KJaH3JeL/lrEZCdZ+AR6JbgS7i7OpXvtDtnMKmBZZsBZONY3xtcUMSJdwwg5ZBWZq z+eT+FdJ+AUu8/Mori8gfZ9WtnIOTWqzTpeyW25zX8W5wJVFGVqykchfVDB98/slDy htmSjd7lP5aXOH6iRTk/KkqENrgtepTUbZBnfQF7wXmW6ySgzQutwZtOgUC3x9dnc7 mVpBkQXJTUcK9d6DIFXuDhU7/HUfGtcOK7Vaue932B/lOYzmD/Jzv2DvVaPIPmwWrC L1q4yk/xoPD61PoqxPmo1ZVQkaMTF67tAirRfvQyt+Yd+TQMBXS+dLw2v6tti+GuRz oT/1lq8jE7EVg== Date: Sun, 9 Nov 2025 22:52:52 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 03/35] Assume __GNUC__ >= 3 Message-ID: <4c323fe589e0fc9f2efe6e67f4d3e00cac342a98.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- assert/assert.h | 13 +--- dlfcn/dlfcn.h | 4 - include/features.h | 2 +- include/intprops.h | 7 -- include/libc-symbols.h | 14 ---- malloc/obstack.h | 4 - math/complex.h | 7 -- math/tgmath.h | 5 -- misc/sys/cdefs.h | 78 +------------------ posix/bits/cpu-set.h | 24 ------ posix/regex.h | 10 --- posix/sys/types.h | 4 - socket/sys/socket.h | 2 +- sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h | 2 +- sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 5 -- timezone/private.h | 13 +--- 16 files changed, 10 insertions(+), 184 deletions(-) diff --git a/assert/assert.h b/assert/assert.h index 273bf7f35c..32ef0634cc 100644 --- a/assert/assert.h +++ b/assert/assert.h @@ -34,7 +34,7 @@ #define _ASSERT_H 1 #include -#if defined __cplusplus && __GNUC_PREREQ (2,95) +#if defined __cplusplus # define __ASSERT_VOID_CAST static_cast #else # define __ASSERT_VOID_CAST (void) @@ -128,20 +128,11 @@ __END_DECLS : __assert_perror_fail ((errnum), __FILE__, __LINE__, __ASSERT_FUNCTION)) # endif -/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' +/* GCC defines a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. - This is broken in G++ before version 2.6. C9x has a similar variable called __func__, but prefer the GCC one since it demangles C++ function names. */ -# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4) # define __ASSERT_FUNCTION __extension__ __PRETTY_FUNCTION__ -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __ASSERT_FUNCTION __func__ -# else -# define __ASSERT_FUNCTION ((const char *) 0) -# endif -# endif #endif /* NDEBUG. */ diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h index bc73180a20..e266f1ab00 100644 --- a/dlfcn/dlfcn.h +++ b/dlfcn/dlfcn.h @@ -185,7 +185,6 @@ typedef struct { size_t dls_size; /* Size in bytes of the whole buffer. */ unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ -# if __GNUC_PREREQ (3, 0) /* The zero-length array avoids an unwanted array subscript check by the compiler, while the surrounding anonymous union preserves the historic size of the type. At the time of writing, GNU C does @@ -195,9 +194,6 @@ typedef struct Dl_serpath dls_serpath[0]; /* Actually longer, dls_cnt elements. */ Dl_serpath __dls_serpath_pad[1]; }; -# else - Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ -# endif } Dl_serinfo; struct dl_find_object diff --git a/include/features.h b/include/features.h index 877d4c7aa8..7d8095c682 100644 --- a/include/features.h +++ b/include/features.h @@ -534,7 +534,7 @@ #endif /* !ASSEMBLER */ /* Decide whether we can define 'extern inline' functions in headers. */ -#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \ +#if defined __OPTIMIZE__ \ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \ && defined __extern_inline && !(defined __clang__ && defined _LIBC) # define __USE_EXTERN_INLINES 1 diff --git a/include/intprops.h b/include/intprops.h index 126d661156..377706ac3d 100644 --- a/include/intprops.h +++ b/include/intprops.h @@ -84,14 +84,7 @@ /* Does the __typeof__ keyword work? This could be done by 'configure', but for now it's easier to do it by hand. */ -#if (2 <= __GNUC__ \ - || (4 <= __clang_major__) \ - || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ - || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 -#else -# define _GL_HAVE___TYPEOF__ 0 -#endif /* Return 1 if the integer type or expression T might be signed. Return 0 if it is definitely unsigned. T must not be a bit-field expression. diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 2f9453e0d7..1f59b69ecf 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -813,11 +813,7 @@ for linking") /* Define as a marker that can be attached to declarations that might not be used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ -#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _GL_UNUSED __attribute__ ((__unused__)) -#else -# define _GL_UNUSED -#endif /* gcc supports the "unused" attribute on possibly unused labels, and g++ has since version 4.5. Note to support C++ as well as C, @@ -829,19 +825,9 @@ for linking") # define _GL_UNUSED_LABEL #endif -/* The __pure__ attribute was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ -#endif -/* The __const__ attribute was added in gcc 2.95. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) -#else -# define _GL_ATTRIBUTE_CONST /* empty */ -#endif #endif /* !_ISOMAC */ #endif /* libc-symbols.h */ diff --git a/malloc/obstack.h b/malloc/obstack.h index 43457353c3..5b913047e3 100644 --- a/malloc/obstack.h +++ b/malloc/obstack.h @@ -257,10 +257,6 @@ extern int obstack_exit_failure; #define obstack_memory_used(h) _obstack_memory_used (h) -# if ! (2 < __GNUC__ + (8 <= __GNUC_MINOR__)) -# define __extension__ -# endif - /* For GNU C, if not -traditional, we can define these macros to compute all args only once without using a global variable. diff --git a/math/complex.h b/math/complex.h index c925c5c0a3..2e542eb1e0 100644 --- a/math/complex.h +++ b/math/complex.h @@ -33,13 +33,6 @@ __BEGIN_DECLS -/* We might need to add support for more compilers here. But since ISO - C99 is out hopefully all maintained compilers will soon provide the data - types `float complex' and `double complex'. */ -#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97) -# define _Complex __complex__ -#endif - #define complex _Complex /* Narrowest imaginary unit. This depends on the floating-point diff --git a/math/tgmath.h b/math/tgmath.h index 0d830a713b..098760071f 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -49,8 +49,6 @@ #define __HAVE_BUILTIN_TGMATH __GNUC_PREREQ (8, 0) #define __HAVE_BUILTIN_TGMATH_C23 __GNUC_PREREQ (13, 0) -#if __GNUC_PREREQ (2, 7) - /* Certain cases of narrowing macros only need to call a single function so cannot use __builtin_tgmath and do not need any complicated logic. */ @@ -791,9 +789,6 @@ (F ## f64 (X, Y, Z)) # endif # endif -#else -# error "Unsupported compiler; you cannot use " -#endif /* Unary functions defined for real and complex values. */ diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 71e2ec92d5..da6ef07a4a 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -79,7 +79,7 @@ # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else -# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4) +# if defined __cplusplus # if __cplusplus >= 201103L # define __THROW noexcept (true) # else @@ -360,16 +360,11 @@ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#elif __GNUC_PREREQ (2,97) || defined __clang__ -/* GCC 2.97 and clang support C99 flexible array members as an extension, +#else +/* GCC and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#else -/* Pre-2.97 GCC did not support C99 flexible arrays but did have - an equivalent extension with slightly different notation. */ -# define __flexarr [0] -# define __glibc_c99_flexarr_available 1 #endif @@ -406,14 +401,7 @@ #define __REDIRECT_FORTIFY_NTH __REDIRECT_NTH #endif -/* At some point during the gcc 2.96 development the `malloc' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__) # define __attribute_malloc__ __attribute__ ((__malloc__)) -#else -# define __attribute_malloc__ /* Ignore */ -#endif /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ @@ -433,27 +421,12 @@ # define __attribute_alloc_align__(param) /* Ignore. */ #endif -/* At some point during the gcc 2.96 development the `pure' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__) # define __attribute_pure__ __attribute__ ((__pure__)) -#else -# define __attribute_pure__ /* Ignore */ -#endif /* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__) # define __attribute_const__ __attribute__ ((__const__)) -#else -# define __attribute_const__ /* Ignore */ -#endif -#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__) # define __attribute_maybe_unused__ __attribute__ ((__unused__)) -#else -# define __attribute_maybe_unused__ /* Ignore */ -#endif /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally @@ -484,28 +457,13 @@ # define __attribute_deprecated_msg__(msg) __attribute_deprecated__ #endif -/* At some point during the gcc 2.8 development the `format_arg' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. - If several `format_arg' attributes are given for the same function, in +/* If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) -#else -# define __attribute_format_arg__(x) /* Ignore */ -#endif -/* At some point during the gcc 2.97 development the `strfmon' format - attribute for functions was introduced. We don't want to use it - unconditionally (although this would be possible) since it - generates warnings. */ -#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) -#else -# define __attribute_format_strfmon__(a,b) /* Ignore */ -#endif /* The nonnull function attribute marks pointer parameters that must not be NULL. This has the name __nonnull in glibc, @@ -600,25 +558,6 @@ # define __va_arg_pack_len() __builtin_va_arg_pack_len () #endif -/* It is possible to compile containing GCC extensions even if GCC is - run in pedantic mode if the uses are carefully marked using the - `__extension__' keyword. But this is not generally available before - version 2.8. */ -#if !(__GNUC_PREREQ (2,8) || defined __clang__) -# define __extension__ /* Ignore */ -#endif - -/* __restrict is known in EGCS 1.2 and above, and in clang. - It works also in C++ mode (outside of arrays), but only when spelled - as '__restrict', not 'restrict'. */ -#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __restrict restrict -# else -# define __restrict /* Ignore */ -# endif -#endif - /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 and clang support this. @@ -629,23 +568,14 @@ # define __restrict_arr /* Not supported in old GCC. */ #endif -#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect) # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) -#else -# define __glibc_unlikely(cond) (cond) -# define __glibc_likely(cond) (cond) -#endif #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !(__GNUC_PREREQ (4,7) \ || (3 < __clang_major__ + (5 <= __clang_minor__)))) -# if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) -# else -# define _Noreturn -# endif #endif #if __GNUC_PREREQ (8, 0) diff --git a/posix/bits/cpu-set.h b/posix/bits/cpu-set.h index 9dc2d31fa7..c76a6de436 100644 --- a/posix/bits/cpu-set.h +++ b/posix/bits/cpu-set.h @@ -42,19 +42,8 @@ typedef struct } cpu_set_t; /* Access functions for CPU masks. */ -#if __GNUC_PREREQ (2, 91) # define __CPU_ZERO_S(setsize, cpusetp) \ do __builtin_memset (cpusetp, '\0', setsize); while (0) -#else -# define __CPU_ZERO_S(setsize, cpusetp) \ - do { \ - size_t __i; \ - size_t __imax = (setsize) / sizeof (__cpu_mask); \ - __cpu_mask *__bits = (cpusetp)->__bits; \ - for (__i = 0; __i < __imax; ++__i) \ - __bits[__i] = 0; \ - } while (0) -#endif #define __CPU_SET_S(cpu, setsize, cpusetp) \ (__extension__ \ ({ size_t __cpu = (cpu); \ @@ -80,21 +69,8 @@ typedef struct #define __CPU_COUNT_S(setsize, cpusetp) \ __sched_cpucount (setsize, cpusetp) -#if __GNUC_PREREQ (2, 91) # define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0) -#else -# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ - (__extension__ \ - ({ const __cpu_mask *__arr1 = (cpusetp1)->__bits; \ - const __cpu_mask *__arr2 = (cpusetp2)->__bits; \ - size_t __imax = (setsize) / sizeof (__cpu_mask); \ - size_t __i; \ - for (__i = 0; __i < __imax; ++__i) \ - if (__arr1[__i] != __arr2[__i]) \ - break; \ - __i == __imax; })) -#endif #define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ (__extension__ \ diff --git a/posix/regex.h b/posix/regex.h index a7b66a2bfb..4facb457b1 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -643,17 +643,7 @@ extern int re_exec (const char *); 'configure' might #define 'restrict' to those words, so pick a different name. */ #ifndef _Restrict_ -# if defined __restrict \ - || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ - || __clang_major__ >= 3 # define _Restrict_ __restrict -# else -# if 199901L <= __STDC_VERSION__ || defined restrict -# define _Restrict_ restrict -# else -# define _Restrict_ -# endif -# endif #endif /* For the ISO C99 syntax array_name[restrict] diff --git a/posix/sys/types.h b/posix/sys/types.h index ab3037a9da..30e0e88928 100644 --- a/posix/sys/types.h +++ b/posix/sys/types.h @@ -160,11 +160,7 @@ typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; -#if __GNUC_PREREQ (2, 7) typedef int register_t __attribute__ ((__mode__ (__word__))); -#else -typedef int register_t; -#endif /* Some code from BIND tests this macro to see if the types above are defined. */ diff --git a/socket/sys/socket.h b/socket/sys/socket.h index e72f5e722e..905bf167bd 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -54,7 +54,7 @@ enum uses with any of the listed types to be allowed without complaint. G++ 2.7 does not support transparent unions so there we want the old-style declaration, too. */ -#if defined __cplusplus || !__GNUC_PREREQ (2, 7) || !defined __USE_GNU +#if defined __cplusplus || !defined __USE_GNU # define __SOCKADDR_ARG struct sockaddr *__restrict # define __CONST_SOCKADDR_ARG const struct sockaddr * #else diff --git a/sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h b/sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h index 40415aae80..2cbc736a25 100644 --- a/sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h +++ b/sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h @@ -64,7 +64,7 @@ struct riscv_hwprobe { __BEGIN_DECLS -#if defined __cplusplus || !__GNUC_PREREQ (2, 7) +#if defined __cplusplus # define __RISCV_HWPROBE_CPUS_TYPE cpu_set_t * #else /* The fourth argument to __riscv_hwprobe should be a null pointer or a diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 3ad7986ba6..8d290d6e09 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -57,13 +57,8 @@ #define __TIMER_T_TYPE void * #define __BLKSIZE_T_TYPE __SLONGWORD_TYPE #define __FSID_T_TYPE struct { int __val[2]; } -#if __GNUC__ <= 2 -/* Compatibility with g++ 2.95.x. */ -#define __SSIZE_T_TYPE __SWORD_TYPE -#else /* size_t is unsigned long int on s390 -m31. */ #define __SSIZE_T_TYPE __SLONGWORD_TYPE -#endif #define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE diff --git a/timezone/private.h b/timezone/private.h index 278cf25a0b..c7150f349b 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -523,11 +523,7 @@ typedef unsigned long uintmax_t; # endif #endif #ifndef ATTRIBUTE_MAYBE_UNUSED -# if 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define ATTRIBUTE_MAYBE_UNUSED __attribute__((unused)) -# else -# define ATTRIBUTE_MAYBE_UNUSED /* empty */ -# endif #endif #if HAVE___HAS_C_ATTRIBUTE @@ -538,10 +534,8 @@ typedef unsigned long uintmax_t; #ifndef ATTRIBUTE_NORETURN # if 201112 <= __STDC_VERSION__ # define ATTRIBUTE_NORETURN _Noreturn -# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) -# define ATTRIBUTE_NORETURN __attribute__((noreturn)) # else -# define ATTRIBUTE_NORETURN /* empty */ +# define ATTRIBUTE_NORETURN __attribute__((noreturn)) # endif #endif @@ -557,13 +551,8 @@ typedef unsigned long uintmax_t; /* GCC attributes that are useful in tzcode. __attribute__((pure)) is stricter than [[reproducible]], so the latter is an adequate substitute in non-GCC C23 platforms. */ -#if __GNUC__ < 3 -# define ATTRIBUTE_FORMAT(spec) /* empty */ -# define ATTRIBUTE_PURE ATTRIBUTE_REPRODUCIBLE -#else # define ATTRIBUTE_FORMAT(spec) __attribute__((format spec)) # define ATTRIBUTE_PURE __attribute__((pure)) -#endif /* Avoid GCC bug 114833 . Remove this macro and its uses when the bug is fixed in a GCC release, From patchwork Sun Nov 9 21:52:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123841 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0591E385840E for ; Sun, 9 Nov 2025 21:59:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0591E385840E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=PTY3KfcK X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id C57893858C2C for ; Sun, 9 Nov 2025 21:52:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C57893858C2C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C57893858C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725177; cv=none; b=MiYr0UDp96/vlVfqTCnvG1oHZdFpeE89eoGxgMDWyf5S5jo0sG3bytiZylslCnUeTFad+3SHl4lPra/cBK/zLAkGQqsqfi4/kb7Ax+4ki+gLghoo+kf3hnF/k9t9e9z2mylzY8naruBjcLH3zZqp6oJYwoBSou6b5xV2NV2+auI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725177; c=relaxed/simple; bh=4Wdh29z1EolmDv4JDkwP7Wmq0VoUNOxuV1BqEQ4166w=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=emKGrqBMX3s/0vjgoENkooGdcjRwMDgegk3qT7urvoYAc0Ebom+0sze7XG0QNp1knD77ArJ4mC8BzQqEY1a5BVIZv9wTGPnUyUYCjwwxTAcf0EhEcCTdBafG4I7f5Wp74E9S+33YejWipODcQznI+cldHUzjYUbMbWOveLuW8rg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C57893858C2C Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 331544421F for ; Sun, 9 Nov 2025 21:52:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DE1CC113D0; Sun, 9 Nov 2025 21:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725177; bh=4Wdh29z1EolmDv4JDkwP7Wmq0VoUNOxuV1BqEQ4166w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PTY3KfcKesnh0PZqii0sPxXvO+XQNWwM9r37U/jygyXVii6kP0u0g/t7lF5vhee3y KAdH74ZPWUy2IW7Jr6f2oW1GDGGZaLJUPlHEj+fgWGnHpmzukOrsl1cTLD2wiiauL2 Zu2Ps/b/kb2+pN+H8FGS3lCoMg9tTwdwhe8n6XImdDq8npM1/RrBhTlnHh0c2muvyq lLbq+qIpQL/EdtVIRl3aD0f4GcSBhMPw266r6UKw3wBaP0hgx3j1mH1yy/NfQmmP/I g8uImbK/9VvOVqULDBboNVUhoJwQFgWppLun7MUUaCQD0gENC36yxcWcB1YExABXtZ RudzePSGn0HKg== Date: Sun, 9 Nov 2025 22:52:54 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 04/35] Assume __GNUC__ >= 4 Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- math/math.h | 55 ++---------------------------------- math/tgmath.h | 13 ++------- misc/sys/cdefs.h | 41 ++++----------------------- posix/regex.h | 5 +--- stdlib/stdbit.h | 26 ----------------- string/string.h | 2 -- string/strings.h | 3 +- sysdeps/alpha/bits/mathdef.h | 20 ------------- sysdeps/x86/bits/link.h | 6 ---- timezone/private.h | 4 --- 10 files changed, 12 insertions(+), 163 deletions(-) diff --git a/math/math.h b/math/math.h index a51edc59a6..8113e6784c 100644 --- a/math/math.h +++ b/math/math.h @@ -44,24 +44,10 @@ __BEGIN_DECLS /* Value returned on overflow. With IEEE 754 floating point, this is +Infinity, otherwise the largest representable positive value. */ -#if __GNUC_PREREQ (3, 3) # define HUGE_VAL (__builtin_huge_val ()) -#else -/* This may provoke compiler warnings, and may not be rounded to - +Infinity in all IEEE 754 rounding modes, but is the best that can - be done in ISO C while remaining a constant expression. 10,000 is - greater than the maximum (decimal) exponent for all supported - floating-point formats and widths. */ -# define HUGE_VAL 1e10000 -#endif #ifdef __USE_ISOC99 -# if __GNUC_PREREQ (3, 3) # define HUGE_VALF (__builtin_huge_valf ()) # define HUGE_VALL (__builtin_huge_vall ()) -# else -# define HUGE_VALF 1e10000f -# define HUGE_VALL 1e10000L -# endif #endif #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) # define HUGE_VAL_F16 (__builtin_huge_valf16 ()) @@ -88,33 +74,20 @@ __BEGIN_DECLS #ifdef __USE_ISOC99 /* IEEE positive infinity. */ # ifndef INFINITY -# if __GNUC_PREREQ (3, 3) # define INFINITY (__builtin_inff ()) -# else -# define INFINITY HUGE_VALF -# endif # endif /* IEEE Not A Number. */ # ifndef NAN -# if __GNUC_PREREQ (3, 3) # define NAN (__builtin_nanf ("")) -# else -/* This will raise an "invalid" exception outside static initializers, - but is the best that can be done in ISO C while remaining a - constant expression. */ -# define NAN (0.0f / 0.0f) -# endif # endif #endif /* __USE_ISOC99 */ #if __GLIBC_USE (IEC_60559_BFP_EXT) -/* Signaling NaN macros, if supported. */ -# if __GNUC_PREREQ (3, 3) +/* Signaling NaN macros. */ # define SNANF (__builtin_nansf ("")) # define SNAN (__builtin_nans ("")) # define SNANL (__builtin_nansl ("")) -# endif #endif #if (__HAVE_FLOAT16 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ @@ -951,10 +924,8 @@ enum in C++ mode, since libstdc++ provides its own version of signbit in cmath (which undefines signbit). */ # define signbit(x) __builtin_signbitl (x) -# elif __GNUC_PREREQ (4,0) -# define signbit(x) __MATH_TG ((x), __builtin_signbit, (x)) # else -# define signbit(x) __MATH_TG ((x), __signbit, (x)) +# define signbit(x) __MATH_TG ((x), __builtin_signbit, (x)) # endif /* Return nonzero value if X is not +-Inf or NaN. */ @@ -1265,7 +1236,6 @@ iszero (__T __val) #endif #ifdef __USE_ISOC99 -# if __GNUC_PREREQ (3, 1) /* ISO C99 defines some macros to compare number while taking care for unordered numbers. Many FPUs provide special instructions to support these operations. Generic support in GCC for these as builtins went @@ -1278,27 +1248,6 @@ iszero (__T __val) # define islessequal(x, y) __builtin_islessequal(x, y) # define islessgreater(x, y) __builtin_islessgreater(x, y) # define isunordered(x, y) __builtin_isunordered(x, y) -# else -# define isgreater(x, y) \ - (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ - !isunordered (__x, __y) && __x > __y; })) -# define isgreaterequal(x, y) \ - (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ - !isunordered (__x, __y) && __x >= __y; })) -# define isless(x, y) \ - (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ - !isunordered (__x, __y) && __x < __y; })) -# define islessequal(x, y) \ - (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ - !isunordered (__x, __y) && __x <= __y; })) -# define islessgreater(x, y) \ - (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \ - !isunordered (__x, __y) && __x != __y; })) -/* isunordered must always check both operands first for signaling NaNs. */ -# define isunordered(x, y) \ - (__extension__ ({ __typeof__ (x) __u = (x); __typeof__ (y) __v = (y); \ - __u != __v && (__u != __u || __v != __v); })) -# endif #endif #if __GLIBC_USE (IEC_60559_BFP_EXT_C23) diff --git a/math/tgmath.h b/math/tgmath.h index 098760071f..88ff014104 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -195,9 +195,8 @@ constant expressions. All these macros can assume their argument has an arithmetic type (not vector, decimal floating-point or fixed-point), valid to pass to tgmath.h macros. */ -# if __GNUC_PREREQ (3, 1) -/* __builtin_classify_type expands to an integer constant expression - in GCC 3.1 and later. Default conversions applied to the argument +/* __builtin_classify_type expands to an integer constant expression. + Default conversions applied to the argument of __builtin_classify_type mean it always returns 1 for real integer types rather than ever returning different values for character, boolean or enumerated types. */ @@ -208,14 +207,6 @@ # define __complex_integer_type(type) \ (__builtin_classify_type ((type) 0) == 9 \ && __builtin_classify_type (__real__ ((type) 0)) == 1) -# else -/* GCC versions predating __builtin_classify_type are also looser on - what counts as an integer constant expression. */ -# define __floating_type(type) (((type) 1.25) != 1) -# define __real_integer_type(type) (((type) (1.25 + _Complex_I)) == 1) -# define __complex_integer_type(type) \ - (((type) (1.25 + _Complex_I)) == (1 + _Complex_I)) -# endif /* Whether an expression (of arithmetic type) has a real type. */ # define __expr_is_real(E) (__builtin_classify_type (E) != 9) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index da6ef07a4a..53e4355862 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -72,8 +72,7 @@ gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ -# if !defined __cplusplus \ - && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__)) +# if !defined __cplusplus # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct @@ -428,23 +427,10 @@ # define __attribute_maybe_unused__ __attribute__ ((__unused__)) -/* At some point during the gcc 3.1 development the `used' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) -#else -# define __attribute_used__ __attribute__ ((__unused__)) -# define __attribute_noinline__ /* Ignore */ -#endif -/* Since version 3.2, gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) -#else -# define __attribute_deprecated__ /* Ignore */ -#endif /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but @@ -470,11 +456,7 @@ and __attribute_nonnull__ in files shared with Gnulib to avoid collision with a different __nonnull in DragonFlyBSD 5.9. */ #ifndef __attribute_nonnull__ -# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__) # define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params)) -# else -# define __attribute_nonnull__(params) -# endif #endif #ifndef __nonnull # define __nonnull(params) __attribute_nonnull__ (params) @@ -492,30 +474,20 @@ /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__) -# define __attribute_warn_unused_result__ \ +#define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) -# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 -# define __wur __attribute_warn_unused_result__ -# endif +#if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 +# define __wur __attribute_warn_unused_result__ #else -# define __attribute_warn_unused_result__ /* empty */ -#endif -#ifndef __wur # define __wur /* Ignore */ #endif /* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ # undef __always_inline # define __always_inline __inline __attribute__ ((__always_inline__)) -#else -# undef __always_inline -# define __always_inline __inline -#endif /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ @@ -560,12 +532,11 @@ /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] - GCC 3.1 and clang support this. This syntax is not usable in C++ mode. */ -#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus +#if !defined __cplusplus # define __restrict_arr __restrict #else -# define __restrict_arr /* Not supported in old GCC. */ +# define __restrict_arr #endif # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) diff --git a/posix/regex.h b/posix/regex.h index 4facb457b1..4e4dcb8515 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -654,10 +654,7 @@ extern int re_exec (const char *); # ifdef __restrict_arr # define _Restrict_arr_ __restrict_arr # else -# if ((199901L <= __STDC_VERSION__ \ - || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - || __clang_major__ >= 3) \ - && !defined __cplusplus) +# if !defined __cplusplus # define _Restrict_arr_ _Restrict_ # else # define _Restrict_arr_ diff --git a/stdlib/stdbit.h b/stdlib/stdbit.h index 4afa4362d1..63e8c5f1b9 100644 --- a/stdlib/stdbit.h +++ b/stdlib/stdbit.h @@ -72,7 +72,6 @@ extern unsigned int stdc_leading_zeros_ull (unsigned long long int __x) - (unsigned int) (8 * (sizeof (0ULL) - sizeof (x)))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int __clz64_inline (uint64_t __x) { @@ -106,7 +105,6 @@ __clz8_inline (uint8_t __x) # define stdc_leading_zeros_ul(x) (__clz32_inline (x)) # endif # define stdc_leading_zeros_ull(x) (__clz64_inline (x)) -#endif /* Count leading ones. */ extern unsigned int stdc_leading_ones_uc (unsigned char __x) @@ -128,7 +126,6 @@ extern unsigned int stdc_leading_ones_ull (unsigned long long int __x) << 8 * (sizeof (0ULL) - sizeof (x)))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int __clo64_inline (uint64_t __x) { @@ -162,7 +159,6 @@ __clo8_inline (uint8_t __x) # define stdc_leading_ones_ul(x) (__clo32_inline (x)) # endif # define stdc_leading_ones_ull(x) (__clo64_inline (x)) -#endif /* Count trailing zeros. */ extern unsigned int stdc_trailing_zeros_uc (unsigned char __x) @@ -186,7 +182,6 @@ extern unsigned int stdc_trailing_zeros_ull (unsigned long long int __x) : stdc_trailing_zeros_uc (__pacify_uint8 (x))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int __ctz64_inline (uint64_t __x) { @@ -220,7 +215,6 @@ __ctz8_inline (uint8_t __x) # define stdc_trailing_zeros_ul(x) (__ctz32_inline (x)) # endif # define stdc_trailing_zeros_ull(x) (__ctz64_inline (x)) -#endif /* Count trailing ones. */ extern unsigned int stdc_trailing_ones_uc (unsigned char __x) @@ -240,7 +234,6 @@ extern unsigned int stdc_trailing_ones_ull (unsigned long long int __x) # define stdc_trailing_ones(x) (stdc_trailing_ones_ull (x)) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int __cto64_inline (uint64_t __x) { @@ -274,7 +267,6 @@ __cto8_inline (uint8_t __x) # define stdc_trailing_ones_ul(x) (__cto32_inline (x)) # endif # define stdc_trailing_ones_ull(x) (__cto64_inline (x)) -#endif /* First leading zero. */ extern unsigned int stdc_first_leading_zero_uc (unsigned char __x) @@ -298,7 +290,6 @@ extern unsigned int stdc_first_leading_zero_ull (unsigned long long int __x) : stdc_first_leading_zero_uc (__pacify_uint8 (x))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int __flz64_inline (uint64_t __x) { @@ -332,7 +323,6 @@ __flz8_inline (uint8_t __x) # define stdc_first_leading_zero_ul(x) (__flz32_inline (x)) # endif # define stdc_first_leading_zero_ull(x) (__flz64_inline (x)) -#endif /* First leading one. */ extern unsigned int stdc_first_leading_one_uc (unsigned char __x) @@ -356,7 +346,6 @@ extern unsigned int stdc_first_leading_one_ull (unsigned long long int __x) : stdc_first_leading_one_uc (__pacify_uint8 (x))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int __flo64_inline (uint64_t __x) { @@ -390,7 +379,6 @@ __flo8_inline (uint8_t __x) # define stdc_first_leading_one_ul(x) (__flo32_inline (x)) # endif # define stdc_first_leading_one_ull(x) (__flo64_inline (x)) -#endif /* First trailing zero. */ extern unsigned int stdc_first_trailing_zero_uc (unsigned char __x) @@ -414,7 +402,6 @@ extern unsigned int stdc_first_trailing_zero_ull (unsigned long long int __x) : stdc_first_trailing_zero_uc (__pacify_uint8 (x))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int __ftz64_inline (uint64_t __x) { @@ -448,7 +435,6 @@ __ftz8_inline (uint8_t __x) # define stdc_first_trailing_zero_ul(x) (__ftz32_inline (x)) # endif # define stdc_first_trailing_zero_ull(x) (__ftz64_inline (x)) -#endif /* First trailing one. */ extern unsigned int stdc_first_trailing_one_uc (unsigned char __x) @@ -472,7 +458,6 @@ extern unsigned int stdc_first_trailing_one_ull (unsigned long long int __x) : stdc_first_trailing_one_uc (__pacify_uint8 (x))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_ctzll) static __always_inline unsigned int __fto64_inline (uint64_t __x) { @@ -506,7 +491,6 @@ __fto8_inline (uint8_t __x) # define stdc_first_trailing_one_ul(x) (__fto32_inline (x)) # endif # define stdc_first_trailing_one_ull(x) (__fto64_inline (x)) -#endif /* Count zeros. */ extern unsigned int stdc_count_zeros_uc (unsigned char __x) @@ -528,7 +512,6 @@ extern unsigned int stdc_count_zeros_ull (unsigned long long int __x) - (unsigned int) (8 * (sizeof (0ULL) - sizeof (x)))) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_popcountll) static __always_inline unsigned int __cz64_inline (uint64_t __x) { @@ -562,7 +545,6 @@ __cz8_inline (uint8_t __x) # define stdc_count_zeros_ul(x) (__cz32_inline (x)) # endif # define stdc_count_zeros_ull(x) (__cz64_inline (x)) -#endif /* Count ones. */ extern unsigned int stdc_count_ones_uc (unsigned char __x) @@ -582,7 +564,6 @@ extern unsigned int stdc_count_ones_ull (unsigned long long int __x) # define stdc_count_ones(x) (stdc_count_ones_ull (x)) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_popcountll) static __always_inline unsigned int __co64_inline (uint64_t __x) { @@ -616,7 +597,6 @@ __co8_inline (uint8_t __x) # define stdc_count_ones_ul(x) (__co32_inline (x)) # endif # define stdc_count_ones_ull(x) (__co64_inline (x)) -#endif /* Single-bit check. */ extern bool stdc_has_single_bit_uc (unsigned char __x) @@ -691,7 +671,6 @@ extern unsigned int stdc_bit_width_ull (unsigned long long int __x) # define stdc_bit_width(x) (stdc_bit_width_ull (x)) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline unsigned int __bw64_inline (uint64_t __x) { @@ -725,7 +704,6 @@ __bw8_inline (uint8_t __x) # define stdc_bit_width_ul(x) (__bw32_inline (x)) # endif # define stdc_bit_width_ull(x) (__bw64_inline (x)) -#endif /* Bit floor. */ extern unsigned char stdc_bit_floor_uc (unsigned char __x) @@ -745,7 +723,6 @@ extern unsigned long long int stdc_bit_floor_ull (unsigned long long int __x) # define stdc_bit_floor(x) ((__typeof (x)) stdc_bit_floor_ull (x)) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline uint64_t __bf64_inline (uint64_t __x) { @@ -781,7 +758,6 @@ __bf8_inline (uint8_t __x) # define stdc_bit_floor_ul(x) ((unsigned long int) __bf32_inline (x)) # endif # define stdc_bit_floor_ull(x) ((unsigned long long int) __bf64_inline (x)) -#endif /* Bit ceiling. */ extern unsigned char stdc_bit_ceil_uc (unsigned char __x) @@ -801,7 +777,6 @@ extern unsigned long long int stdc_bit_ceil_ull (unsigned long long int __x) # define stdc_bit_ceil(x) ((__typeof (x)) stdc_bit_ceil_ull (x)) #endif -#if __GNUC_PREREQ (3, 4) || __glibc_has_builtin (__builtin_clzll) static __always_inline uint64_t __bc64_inline (uint64_t __x) { @@ -841,7 +816,6 @@ __bc8_inline (uint8_t __x) # define stdc_bit_ceil_ul(x) ((unsigned long int) __bc32_inline (x)) # endif # define stdc_bit_ceil_ull(x) ((unsigned long long int) __bc64_inline (x)) -#endif __END_DECLS diff --git a/string/string.h b/string/string.h index 7c30580437..54faf8ed8e 100644 --- a/string/string.h +++ b/string/string.h @@ -549,12 +549,10 @@ extern char *basename (const char *__filename) __THROW __nonnull ((1)); # endif #endif -#if __GNUC_PREREQ (3,4) # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ # include # endif -#endif __END_DECLS diff --git a/string/strings.h b/string/strings.h index c5f3aa7d83..7ee9ab08a4 100644 --- a/string/strings.h +++ b/string/strings.h @@ -137,8 +137,7 @@ extern int strncasecmp_l (const char *__s1, const char *__s2, __END_DECLS -#if __GNUC_PREREQ (3,4) && __USE_FORTIFY_LEVEL > 0 \ - && defined __fortify_function +#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function /* Functions with security checks. */ # if defined __USE_MISC || !defined __USE_XOPEN2K8 # include diff --git a/sysdeps/alpha/bits/mathdef.h b/sysdeps/alpha/bits/mathdef.h index b24fed2eed..8775c15bfc 100644 --- a/sysdeps/alpha/bits/mathdef.h +++ b/sysdeps/alpha/bits/mathdef.h @@ -21,24 +21,4 @@ #if defined _COMPLEX_H && !defined _COMPLEX_H_MATHDEF # define _COMPLEX_H_MATHDEF 1 -# if !__GNUC_PREREQ(3,4) - -/* Due to an ABI change, we need to remap the complex float symbols. */ -# define _Mdouble_ float -# define __MATHCALL(function, args) \ - __MATHDECL (_Complex float, function, args) -# define __MATHDECL(type, function, args) \ - __MATHDECL_1(type, function##f, args, __c1_##function##f); \ - __MATHDECL_1(type, __##function##f, args, __c1_##function##f) -# define __MATHDECL_1(type, function, args, alias) \ - extern type function args __asm__(#alias) __THROW - -# include - -# undef _Mdouble_ -# undef __MATHCALL -# undef __MATHDECL -# undef __MATHDECL_1 - -# endif /* GNUC before 3.4 */ #endif /* COMPLEX_H */ diff --git a/sysdeps/x86/bits/link.h b/sysdeps/x86/bits/link.h index 1f149569d3..57cd2150c8 100644 --- a/sysdeps/x86/bits/link.h +++ b/sysdeps/x86/bits/link.h @@ -64,22 +64,16 @@ __END_DECLS #else /* Registers for entry into PLT on x86-64. */ -# if __GNUC_PREREQ (4,0) typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16))); typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32), __aligned__ (16))); typedef double La_x86_64_zmm __attribute__ ((__vector_size__ (64), __aligned__ (16))); -# else -typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__))); -# endif typedef union { -# if __GNUC_PREREQ (4,0) La_x86_64_ymm ymm[2]; La_x86_64_zmm zmm[1]; -# endif La_x86_64_xmm xmm[4]; } La_x86_64_vector __attribute__ ((__aligned__ (16))); diff --git a/timezone/private.h b/timezone/private.h index c7150f349b..fcd71a044d 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -497,11 +497,7 @@ typedef unsigned long uintmax_t; # endif #endif #ifndef ATTRIBUTE_DEPRECATED -# if 3 < __GNUC__ + (2 <= __GNUC_MINOR__) # define ATTRIBUTE_DEPRECATED __attribute__((deprecated)) -# else -# define ATTRIBUTE_DEPRECATED /* empty */ -# endif #endif #if HAVE___HAS_C_ATTRIBUTE From patchwork Sun Nov 9 21:52:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123839 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0BDA3858C2C for ; Sun, 9 Nov 2025 21:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0BDA3858C2C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pEGT4/DC X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id B15CC3858419 for ; Sun, 9 Nov 2025 21:53:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B15CC3858419 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B15CC3858419 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725180; cv=none; b=GShys1+QTbflSrEjygdQYUmEKak16qYCV6k/obhSoUTh/DwlWrP1jBi7ecXAy43ArBvgMwRmKr5mw+fXeySSowie/tNZ+PYxqhorwH1Qc37WHFGY+5S9/1lWBJsa+XKRbKBAadL2qAY54FVGSBInkfmgmWC6ORU8SzAvc2rMnDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725180; c=relaxed/simple; bh=Vho1tkZBek3QXWROO5q4Has/ETnuDLovOK6tM/1c2W0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=uFO/Hg/1BsTVRMto1qpjyDkNKaRmE2gfILBl3hD9a7Mf2KIA1z/+tDObnA3wJAiYyzDh+mDydQwNdBc2RaS4eckBIVKeRYQ0eZ6eemjyKnpazgKHS3kXpyyKZRehiDOJq/49PA39tK6g54exL77N7QKR7oajH1spp+yRN0cuQ0A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B15CC3858419 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 4D8B960007 for ; Sun, 9 Nov 2025 21:53:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A102C4CEFB; Sun, 9 Nov 2025 21:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725179; bh=Vho1tkZBek3QXWROO5q4Has/ETnuDLovOK6tM/1c2W0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pEGT4/DCy6i2+ZqRS2CXHKTOBCT/q+atcxTOaE2eFQspHApLjf/ph/OnbHDMgVs2p 7ZBwrp2aYov9G2wC/CGk6C4ndB/HCAAFDHILcmO9C4+deVDAxP/n3woNafr59PLkZz KRrKbnA2kDcdcPj4cq6XwzQJbZNLYl2MFyO/97Na/WCb3WbK9vO6X8wLEmXK055Icw /sykgcJP+v740zjkMR9CqvW8rBMRdiFN6Z02O0tPmeAER6HKq3qgxYbU4oz/OdCgRV qB5tNoHTDMGGJenAnm8e9mL0NG4rXBc+EI9fRtKXI6Wr3PPhxdsv1x2ipNK2d04/7t +AO9RIAzJkZHA== Date: Sun, 9 Nov 2025 22:52:57 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 05/35] Assume GCC 4.2 or later Message-ID: <6e85d41473b7adf69409a28d3cb4e5173ef66f9f.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org This is what Clang claims to support. $ clang --version; Debian clang version 19.1.7 (3+b1) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-19/bin $ echo __GNUC__ __GNUC_MINOR__ \ | clang -E -x c /dev/stdin \ | tail -n1; 4 2 Signed-off-by: Alejandro Colomar --- include/features.h | 2 -- misc/sys/cdefs.h | 4 ---- 2 files changed, 6 deletions(-) diff --git a/include/features.h b/include/features.h index 7d8095c682..c067077139 100644 --- a/include/features.h +++ b/include/features.h @@ -433,8 +433,6 @@ #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 # warning _FORTIFY_SOURCE requires compiling with optimization (-O) -# elif !__GNUC_PREREQ (4, 1) -# warning _FORTIFY_SOURCE requires GCC 4.1 or later # elif _FORTIFY_SOURCE > 2 && (__glibc_clang_prereq (9, 0) \ || __GNUC_PREREQ (12, 0)) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 53e4355862..6a680adcde 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -716,11 +716,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf /* Specify that a function such as setjmp or vfork may return twice. */ -#if __GNUC_PREREQ (4, 1) # define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) -#else -# define __attribute_returns_twice__ /* Ignore. */ -#endif /* Mark struct types as aliasable. Restricted to compilers that support forward declarations of structs in the presence of the From patchwork Sun Nov 9 21:53:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123845 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E46403858D33 for ; Sun, 9 Nov 2025 22:03:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E46403858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=YeLjwYAX X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 6D7273858409 for ; Sun, 9 Nov 2025 21:53:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D7273858409 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6D7273858409 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725183; cv=none; b=i7lOvinnefasY1qi7q2oqqYG799PzYVEkKuo7WNDwZMOsjIgN95blIXds5kHy5Jo6OXFvStjIxX7iCjxyE69ep75fW1ikEEur3X0KzKmjeDbqhZshqhzVhxFMBbriZtSZVkkEZtXEe/WDD4HNGiOwwFBUMPuOuTswd4JlTZh0xw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725183; c=relaxed/simple; bh=AL5zbHHUeDO6MUjEJL/zYW1v+BgJn6yZwJwdMQ8QeUw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=lHezuVozEn7Tb/41Sn2rX+YA+b5vTB8WT2aKvQkr2zeRK5gSGG56zBue0jKCaQqZGHoZOIk24rgpTE3RbMlwOtn8Xus7z2lhFVWrIScVqSSzkGvbFxERSUQfM8jbCnk2ewIolD6Be4tl0d0EG9kGdWpd0k4Wbv4u1bqQ3vWrtlc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D7273858409 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 15A4860052 for ; Sun, 9 Nov 2025 21:53:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1922BC19421; Sun, 9 Nov 2025 21:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725182; bh=AL5zbHHUeDO6MUjEJL/zYW1v+BgJn6yZwJwdMQ8QeUw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YeLjwYAXkhxWRhnQ/oLmXLPwmASg8/YwtIutVAjoKbeQO6a0NcArq180UfytLDyxR rIDP32BIjl5IyHE7i7SIu6xrUWgsULUmja3xQHvBrfk2OBSGe6IClq8w3CLHGCCnQA zH444zfvHzeaFYXSojAZHpWUYqOhsaXK7k4xiuIykTTp0VSmtbMOsldwNEhjVpQjMc XyY4i2SGMI5yh6lcNW8RpP5ZHClkFaG8rZF/i4med/22vjKTwQ1Jbt/H0PZ/PDsWQ/ +hM8mPQCLmoXzuYdSX5vGvmKxCMEX52gjspnKqZQH/TDyxctc1usLOcJAu/vusNIau JykyZEypfBBHQ== Date: Sun, 9 Nov 2025 22:53:00 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 06/35] include/intprops.h: Remove dead code due to _GL__GENERIC_BOGUS Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as 1. Signed-off-by: Alejandro Colomar --- include/intprops.h | 47 ---------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/include/intprops.h b/include/intprops.h index 377706ac3d..149513a1d0 100644 --- a/include/intprops.h +++ b/include/intprops.h @@ -408,52 +408,6 @@ _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW) #endif -/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 - https://llvm.org/bugs/show_bug.cgi?id=25390 - For now, assume all versions of GCC-like compilers generate bogus - warnings for _Generic. This matters only for compilers that - lack relevant builtins. */ -# define _GL__GENERIC_BOGUS 1 - -/* Store the low-order bits of A B into *R, where OP specifies - the operation and OVERFLOW the overflow predicate. Return 1 if the - result overflows. See above for restrictions. */ -#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS -# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ - (_Generic \ - (*(r), \ - signed char: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - signed char, SCHAR_MIN, SCHAR_MAX), \ - unsigned char: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - unsigned char, 0, UCHAR_MAX), \ - short int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - short int, SHRT_MIN, SHRT_MAX), \ - unsigned short int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - unsigned short int, 0, USHRT_MAX), \ - int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - int, INT_MIN, INT_MAX), \ - unsigned int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \ - unsigned int, 0, UINT_MAX), \ - long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ - long int, LONG_MIN, LONG_MAX), \ - unsigned long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ - unsigned long int, 0, ULONG_MAX), \ - long long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ - long long int, LLONG_MIN, LLONG_MAX), \ - unsigned long long int: \ - _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \ - unsigned long long int, 0, ULLONG_MAX))) -#else /* Store the low-order bits of A B into *R, where OP specifies the operation and OVERFLOW the overflow predicate. If *R is signed, its type is ST with bounds SMIN..SMAX; otherwise its type @@ -512,7 +466,6 @@ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ unsigned long int, 0, ULONG_MAX)) # endif -#endif /* Store the low-order bits of A B into *R, where the operation is given by OP. Use the unsigned type UT for calculation to avoid From patchwork Sun Nov 9 21:53:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123840 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3ED163858C2C for ; Sun, 9 Nov 2025 21:58:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ED163858C2C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=HebIwqMX X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 0B513385840E for ; Sun, 9 Nov 2025 21:53:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B513385840E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0B513385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725186; cv=none; b=gNkG4/0nnjV5RkGL30zhg2qieQwXnzkMgXfgBZzDuvROGamK8yigyYUgZsuHeO1haABvfLO06E1Lx1l1EaIClZYFdp3lHpkcKwC923mrB6ajdpolRDcUYSuz8sRf3OjP8C1yKRxHSldMh/41dJOSlYfx96Gp6+l3ToRN88HgnWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725186; c=relaxed/simple; bh=kJJpIi+4HbBC+fXBnBZ8H7hAW+P9S9cXBTselSG2ZxA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=NGJsBZbTjxztNLsnzjPvrJhvfAPSfryjj+tiAuHHX0PgWwfXlt8amOSdqfl9d8v7Qy5D8WNN+50qO7eXwJ4ki4ORlJIgD9n3CYeooJ4hWjCM7tbxrmsGaPgweBOEguKWe+KuvmNTYtyPImTMWGLREl24Qewj1uzc+z5dOjeqBW8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B513385840E Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A9A1560008 for ; Sun, 9 Nov 2025 21:53:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAAEAC4CEF7; Sun, 9 Nov 2025 21:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725185; bh=kJJpIi+4HbBC+fXBnBZ8H7hAW+P9S9cXBTselSG2ZxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HebIwqMXfs9KI1KVHhmWwWiUiXwASqGTPgK9DeqAakJYhLN/ID7joaS8beYXZ/xTC 6HJ7b8avOdqNeY4vFThYqb8arvDHs0hzvYo674uY3R91X20bp5W01GlzUFDgjJ5BvH RmughWe/SH29bA0SnEktl5Gp5IB/+gq4nrVlYMWXYwyhGQiS9AXJYubb07zHf3TpM1 vttv2GsyT6VnSh6WaTy1PGS3XuE3yBl5w7JvyewUe63dMfisEH3NoPLKzUJt1mBea+ NZ46KB2HzOSL+SD+gcggQFlsCdab1PRpUyzWsUmvQliyDdmkTYRgH2mzVzIOtN802+ s9C8sY5tM6OPA== Date: Sun, 9 Nov 2025 22:53:03 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 07/35] intl/: Remove ZERO macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We may want to use [], BTW, since GCC supports it since 2.97. Signed-off-by: Alejandro Colomar --- intl/dcigettext.c | 4 ++-- intl/gettextP.h | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index fe5c19bf37..152ccfc94b 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -241,7 +241,7 @@ struct known_translation_t /* Pointer to the string in question. */ union { - char appended[ZERO]; /* used if domain != NULL */ + char appended[0]; /* used if domain != NULL */ const char *ptr; /* used if domain == NULL */ } msgid; @@ -362,7 +362,7 @@ static const char *get_output_charset (struct binding *domainbinding); typedef struct transmem_list { struct transmem_list *next; - char data[ZERO]; + char data[0]; } transmem_block_t; static struct transmem_list *transmem_list; #else diff --git a/intl/gettextP.h b/intl/gettextP.h index 869d25051e..d7f4c56d9d 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -195,10 +195,6 @@ struct loaded_domain unsigned long int nplurals; }; -/* We want to allocate a string at the end of the struct. But ISO C - doesn't allow zero sized arrays. */ -# define ZERO 0 - /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding @@ -206,7 +202,7 @@ struct binding struct binding *next; char *dirname; char *codeset; - char domainname[ZERO]; + char domainname[0]; }; /* A counter which is incremented each time some previous translations From patchwork Sun Nov 9 21:53:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123843 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C166E3858402 for ; Sun, 9 Nov 2025 22:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C166E3858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=DnXWUEy8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id B432D3858405 for ; Sun, 9 Nov 2025 21:53:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B432D3858405 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B432D3858405 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725188; cv=none; b=dW3oj49mIXQSNdmqj1bPohS9LXuriS3T92TOFYxeozAe1bZ7O6/9d9YsJ4L9XkyvI32SVKuQN9BsiOaaMvI4vMrsgWiFrmXrtk4Q791cRHuSam+5MbRhzAZLB/uXfnLp+x/GIt5n9W1K6eZ4RnRviS1ncSyvqK7Pc1tINg3Q3GM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725188; c=relaxed/simple; bh=i+9j8UXSuP+x3shrfya/v/FeqVn5ByFfXOy/HHSIBbg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=pTfbaEht8GxHC1AY6HNXIA967frxamXvR2HE7W4adPZ2x9ThihH5ozurgoHm4fkZ8Bjf2SA/eYFDfe9ABH1xMTsth4UpuoUvD2sU26MATjGUt648f4laZKNH7ZOV5Eq62El/VYIzmOwwc4f20I5Ys/BgR27e9r+B/plohLEuBdk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B432D3858405 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 28614444AE for ; Sun, 9 Nov 2025 21:53:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59AC4C4CEF7; Sun, 9 Nov 2025 21:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725188; bh=i+9j8UXSuP+x3shrfya/v/FeqVn5ByFfXOy/HHSIBbg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DnXWUEy8dGBlj3hgCltBCTFtQoJssil2Ef2QBITi3AjFtB3M1jgfSciXORn9deJ2Q X3GVl4tpVL9BszxcU/Du7YgwfpppHfbZWwi4n3ozO26yxF96SP8tCjfRq6j7hreYb+ KiJ4uKRmkUUnIxlYPPJNKzLC2NtpdFQ1LXE07vk7GlIEUX2vTy01JFRCsGZ21gyIof /FDpaeH4QLV0z44zhhyGGBcrR4HCcC3enYN6oPkOGyfyDzNZOKaus2PlDiIShuYbS+ nnrnp3dj1/bmjLCdOQPB57VHZJeYpqwzH+NQ2l/ZNXy3OfXHYjo1FwDAtpiJ811xz/ kmET5BTdJOHtA== Date: Sun, 9 Nov 2025 22:53:05 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 08/35] Remove __flexarr macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as []. Signed-off-by: Alejandro Colomar --- bits/socket.h | 2 +- locale/localeinfo.h | 2 +- misc/sys/cdefs.h | 2 -- sysdeps/generic/unwind-dw2-fde.h | 6 +++--- sysdeps/mach/hurd/bits/socket.h | 2 +- sysdeps/unix/sysv/linux/bits/socket.h | 2 +- sysdeps/unix/sysv/linux/sys/inotify.h | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bits/socket.h b/bits/socket.h index e83ad5bc01..41910dbe65 100644 --- a/bits/socket.h +++ b/bits/socket.h @@ -222,7 +222,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ /* This field is to be aligned with CMSG_ALIGN */ - /* __extension__ unsigned char __cmsg_data __flexarr; */ /* Ancillary data. */ + /* __extension__ unsigned char __cmsg_data[]; */ /* Ancillary data. */ }; /* Ancillary data object manipulation macros. */ diff --git a/locale/localeinfo.h b/locale/localeinfo.h index f503792d04..6f225c3647 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -79,7 +79,7 @@ struct __locale_data const char *string; unsigned int word; /* Note endian issues vs 64-bit pointers. */ } - values __flexarr; /* Items, usually pointers into `filedata'. */ + values[]; /* Items, usually pointers into `filedata'. */ }; /* This alignment is used for 32-bit integers in locale files, both diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 6a680adcde..87c3581bb7 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -357,12 +357,10 @@ (e.g. only if they won't affect sizeof()) should test #if __glibc_c99_flexarr_available. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc -# define __flexarr [] # define __glibc_c99_flexarr_available 1 #else /* GCC and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ -# define __flexarr [] # define __glibc_c99_flexarr_available 1 #endif diff --git a/sysdeps/generic/unwind-dw2-fde.h b/sysdeps/generic/unwind-dw2-fde.h index 37a5ad3480..8972af47c2 100644 --- a/sysdeps/generic/unwind-dw2-fde.h +++ b/sysdeps/generic/unwind-dw2-fde.h @@ -22,7 +22,7 @@ struct fde_vector { void *orig_data; size_t count; - struct dwarf_fde *array __flexarr; + struct dwarf_fde *array[]; }; #ifdef _LIBC @@ -128,7 +128,7 @@ struct dwarf_cie uword length; sword CIE_id; ubyte version; - unsigned char augmentation __flexarr; + unsigned char augmentation[]; } __attribute__ ((packed, aligned (__alignof__ (void *)))); /* The first few fields of an FDE. */ @@ -136,7 +136,7 @@ struct dwarf_fde { uword length; sword CIE_delta; - unsigned char pc_begin __flexarr; + unsigned char pc_begin[]; } __attribute__ ((packed, aligned (__alignof__ (void *)))); typedef struct dwarf_fde fde; diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h index 8c18cef579..9b51c5c431 100644 --- a/sysdeps/mach/hurd/bits/socket.h +++ b/sysdeps/mach/hurd/bits/socket.h @@ -229,7 +229,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ /* This field is to be aligned with CMSG_ALIGN */ - /* __extension__ unsigned char __cmsg_data __flexarr; */ /* Ancillary data. */ + /* __extension__ unsigned char __cmsg_data[]; */ /* Ancillary data. */ }; /* Ancillary data object manipulation macros. */ diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index f6eb297998..ac22e11c4d 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -290,7 +290,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if __glibc_c99_flexarr_available - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ + __extension__ unsigned char __cmsg_data[]; /* Ancillary data. */ #endif }; diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h index 8b234229be..8b8a7c4694 100644 --- a/sysdeps/unix/sysv/linux/sys/inotify.h +++ b/sysdeps/unix/sysv/linux/sys/inotify.h @@ -31,7 +31,7 @@ struct inotify_event uint32_t mask; /* Watch mask. */ uint32_t cookie; /* Cookie to synchronize two events. */ uint32_t len; /* Length (including NULs) of name. */ - char name __flexarr; /* Name. */ + char name[]; /* Name. */ }; From patchwork Sun Nov 9 21:53:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123846 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BEBAE3858C36 for ; Sun, 9 Nov 2025 22:03:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEBAE3858C36 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=bQ/5WErP X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 57BE73858418 for ; Sun, 9 Nov 2025 21:53:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57BE73858418 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57BE73858418 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725191; cv=none; b=c/Sona8MhdMhFo+i90lfpaFbF3BQapGsRQ0dmIbbTsNr5dYJfD42o9rm3ysZTW5u3cBzA74gVOMjcht/K/ivgyQUjN0pLwhZV5cCHToAvhuwFMBXtTVKnSrEREKz5Dm30hvOBWeQj8n1Y/ruQBEbBo3qR0ROTFdLLMz/bLMtTzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725191; c=relaxed/simple; bh=/4nKEdLfvSQGu77ighQgYa0pHAgx2kBitwzP0/LASJk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=tek8X5SjFpq2Cyb57xrDM4BiF/wsVIHncgCBHZ/eCdjEkK4K9Pt4F+D9ooSeJtkO57uR10Bu8+3dxSSr93+PNujGWC6EdN33ZIELbzzAibZYBvOR6XadzmDVBTgH0aWRFTX5SFd3ak+vuInhF7SkoaphhElm26qYAewVRScG+m8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57BE73858418 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id BFD7543711 for ; Sun, 9 Nov 2025 21:53:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF378C2BCAF; Sun, 9 Nov 2025 21:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725190; bh=/4nKEdLfvSQGu77ighQgYa0pHAgx2kBitwzP0/LASJk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bQ/5WErPaA9McIBD9ojcJWWGvD6XsRqI+KRLTxSoqSqWkDJc40ehtxewL01vRsS4H wuM8M0z9CrhWlI9sjQYDtZvZv1E4/LQKyR/7DuUaq3LYJjJDGie0epDlXJlS24BE5v wcU4PMD9dj1T2c7ipMT2e3Vc0xvQIYfcaTABSLHaTjmQrlitaAXHL+SDZeyFZ/89S8 5v7XHdsrsvQHhNkGOhLzPHoTy9tgjq1xRYmcAi8m0Qvq2S/CHzP3bFYJNZhxBRd7gY ULn/czUQpMakXc5flzu8W/cUGehxMOk2k5yMnY1gU1iMgPNhEZUKJRBaDZ1bgxceMn WQ0zrQFDiJ9EQ== Date: Sun, 9 Nov 2025 22:53:08 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 09/35] Remove dead code due to __glibc_c99_flexarr_available macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as 1. Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 12 ------------ sysdeps/unix/sysv/linux/bits/socket.h | 6 ------ 2 files changed, 18 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 87c3581bb7..12b424e85c 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -352,18 +352,6 @@ # define __errordecl(name, msg) extern void name (void) #endif -/* Support for flexible arrays. - Headers that should use flexible arrays only if they're "real" - (e.g. only if they won't affect sizeof()) should test - #if __glibc_c99_flexarr_available. */ -#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc -# define __glibc_c99_flexarr_available 1 -#else -/* GCC and clang support C99 flexible array members as an extension, - even when in C89 mode or compiling C++ (any version). */ -# define __glibc_c99_flexarr_available 1 -#endif - /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index ac22e11c4d..66d33e8a65 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -289,17 +289,11 @@ struct cmsghdr with this. */ int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ -#if __glibc_c99_flexarr_available __extension__ unsigned char __cmsg_data[]; /* Ancillary data. */ -#endif }; /* Ancillary data object manipulation macros. */ -#if __glibc_c99_flexarr_available # define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) -#else -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) -#endif #define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) #define CMSG_FIRSTHDR(mhdr) \ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ From patchwork Sun Nov 9 21:53:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123844 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 864BC3858420 for ; Sun, 9 Nov 2025 22:00:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 864BC3858420 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LPXWwSv9 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 17B18385841B for ; Sun, 9 Nov 2025 21:53:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 17B18385841B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 17B18385841B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725194; cv=none; b=ZSCJ/tYkab1ZU+dTKDdyg37GDUpx5XkGzEW4rBCe0lxqP2hJVSHIuYJy8P88BixB+Hyq8yOk9ljMZmceaZBSzAH2d0ErKQB8aYevYVyeTrZYOQXITZJ7NwfykQzHEBpwtLNxUtwArXkJdiOrLhizmu25M0fL5gI2LcXRaL0YoeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725194; c=relaxed/simple; bh=4VMTQxZoDHMQ8V9Y3+Y0zR2eAs45BDSpJjcPHTkNl64=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=rdMeW4iHengQbT73JIW85k+0HxmpcPRpCQ+/Dp+d8f2sEdau5IC9/w4ffmbqYGHeHIMDN4KHco85vwCfLzSqmGjTLshAqDvG4pOHVLxW0H3fc1eTksv75H0zefbSLy963dTmJOnhnWBIu434rlMn9N5az563qVavUyeoXoUp9wM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17B18385841B Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id B578D60051 for ; Sun, 9 Nov 2025 21:53:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C42BC19424; Sun, 9 Nov 2025 21:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725193; bh=4VMTQxZoDHMQ8V9Y3+Y0zR2eAs45BDSpJjcPHTkNl64=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LPXWwSv9upbacKSbnvkoa8ulTiK0MkDl3/kJAOO+HDlkrlatpbu0j/swStU4yMb5x QURmdn+Qiq58NOUVx3LHYjeLuUPHOkykFjLSeUCpesQsOdES3CVBo0dgG+PR0/X9Hp 5GVeX8MyUT92+ovNbOsIB9Kt0PJoV2i7ahZkUYhdQV6aZYrO+q2wTh3OOuZwaDJsTh uvCQUDsfy26FdakFOq2ArJs1aZj+AJWLTlVgFCfQmVSnzm5C0if6CmpjeSBWBthZjm vA4rppmzVoYR2JbzlYNKsq1G+RumXHruOHu/BlfEiN4CboenPukk7lHsVmPkfy3m3N kTleaqGhKqG1w== Date: Sun, 9 Nov 2025 22:53:10 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 10/35] stdio-common/vfscanf-internal.c: Remove unused HAVE_LONGLONG macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- stdio-common/vfscanf-internal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c index 48d974ef7d..0afae4b4e8 100644 --- a/stdio-common/vfscanf-internal.c +++ b/stdio-common/vfscanf-internal.c @@ -33,7 +33,6 @@ #include #include -# define HAVE_LONGLONG # define LONGLONG long long /* Determine whether we have to handle `long long' at all. */ From patchwork Sun Nov 9 21:53:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123848 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 78AC13858C39 for ; Sun, 9 Nov 2025 22:04:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78AC13858C39 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=docapZzG X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id B45B13858C52 for ; Sun, 9 Nov 2025 21:53:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B45B13858C52 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B45B13858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725196; cv=none; b=SzlqwNjAD4knx0/p7el2MFPkd0UW8wEuWhfBD+Ke5vUv3fTKyS796kNgz9xOoBm0XqRP638IynGM25d7cHOnPUKCx9iFKAPscD+fCm0vt86Wz8h8U/uTA2kkTJluGW6diuP7PNZ2fq6DgX/wJTQKc7vxAcSi1vF/KeeMtkfKUaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725196; c=relaxed/simple; bh=WurcKcvKtmzdKofRT4DC8LdYC+N3vEj1ZB96OIA/od4=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=trvMVYcvGl4o58YkLrv8KlBjWHp5Zdzzm+e+CX+TG1przS76wjyiuIy6evxeQJpay1tCqxm4E2A9uiRPd2APvqRlDvF0LhWwWX+dDQn2zNZRlcLJPAS7BoOTMgBNBxPEcaQ/IVtKmmmYCrEEqLD017zpaYbRCr/4MkzsXAFIcXc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B45B13858C52 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 5EED960007 for ; Sun, 9 Nov 2025 21:53:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61677C4CEFB; Sun, 9 Nov 2025 21:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725196; bh=WurcKcvKtmzdKofRT4DC8LdYC+N3vEj1ZB96OIA/od4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=docapZzGTGDVwc+GwNDCWjIkW9j0r+JuMe4byYafnbHiTNMgTsHfF3pLhQ67SzUhL f+AHoYBE3FmBrjqo+wNj9qPKFieUBFycpew++iwywBTPsXHgcJwJ/sZAcw5kfKDgXs 3qdUsw2H9RkcM3fFXJsXrxtUtUy+rDMh6nWm8g0o+3oY542faB4PxL+6S4chpKUxIs effi/ebNyx3N9WbFCwgCp+P6kGrnJyTc3iZMm4Tfyhp4IL3q1LNX148VuzQssa7GhK /jyR3jt8YNtGtUJrIR3PsyKdT4LFwJh13jt3AXgnHhpq4+DGtMKEHZfuijiD62OFAl U2NH1lOxrT61A== Date: Sun, 9 Nov 2025 22:53:13 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 11/35] stdio-common/vfscanf-internal.c: Remove LONGLONG macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as 'long long'. Signed-off-by: Alejandro Colomar --- stdio-common/vfscanf-internal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c index 0afae4b4e8..8720cc300a 100644 --- a/stdio-common/vfscanf-internal.c +++ b/stdio-common/vfscanf-internal.c @@ -33,8 +33,6 @@ #include #include -# define LONGLONG long long - /* Determine whether we have to handle `long long' at all. */ #if LONG_MAX == LONG_LONG_MAX # define need_longlong 0 @@ -1971,7 +1969,7 @@ digits_extended_fail: if (flags & NUMBER_SIGNED) { if (need_longlong && (flags & LONGDBL)) - *ARG (LONGLONG int *) = num.q; + *ARG (long long int *) = num.q; else if (need_long && (flags & LONG)) *ARG (long int *) = num.l; else if (flags & SHORT) @@ -1984,7 +1982,7 @@ digits_extended_fail: else { if (need_longlong && (flags & LONGDBL)) - *ARG (unsigned LONGLONG int *) = num.uq; + *ARG (unsigned long long int *) = num.uq; else if (need_long && (flags & LONG)) *ARG (unsigned long int *) = num.ul; else if (flags & SHORT) From patchwork Sun Nov 9 21:53:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123852 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DAFC2385840D for ; Sun, 9 Nov 2025 22:08:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAFC2385840D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=lwEy9Jol X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 369D2385841D for ; Sun, 9 Nov 2025 21:53:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 369D2385841D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 369D2385841D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725199; cv=none; b=XZgwI/5iyUNZp8tyozBRS+Mc/fR87oqZnf5aKuLWXI4rGRgk3wZxQw+EvcE3pRNjb7LVqZ4R1dDlCQFRVBxHPjH/DwJJ74pOVC9w6vyo85CvOZ1eWZmRM6xGG9xPwcox3NH93fygpfhKJWcchizlhhmyAUnWBvQi7NgPrBZ2LeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725199; c=relaxed/simple; bh=HlXe2iMhjoptbkGMiZG2MTpqu4cfL1GFJFCH+/Y6eUo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vMdu1lAx8ZYXoFFExXwaKpFDNGSeFCwFGtBydAATJu3f+emhd5S4mmhYmiErvGYA1SBaETTIMnqDGkTAzgryeTG31wAvir8fbq217Veytg/0N6MABEoX57FMJnUhwvf545BXVF5K06V1WR5cMpN6/d4/9cbHViizgYlCF0KNE+A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 369D2385841D Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D4A2260051 for ; Sun, 9 Nov 2025 21:53:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00B12C116B1; Sun, 9 Nov 2025 21:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725198; bh=HlXe2iMhjoptbkGMiZG2MTpqu4cfL1GFJFCH+/Y6eUo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lwEy9JolFyFqq4/QhpJnUdMLhEYqoP1iWQNAEPOkduiAV0fpOTAa8hlon3Z5nsuBx Y8tgTVbBW6LQ1qmmPunjws+XmaG2fEX/nWZdnyNYdZCGTg4DMsSNOQY0vpDgBhykAt S7sGmCZQlldMPJstX/Lw+oEfasQhkwC5HravPaN2Jwqk73bSs/l7eIXe78EF0ETLa+ tmZjerIxT44+FaVSyQNDJaEEDcfoNpoSweuMQV2HGe34awSGUS3cRDHpn7KmPaFUgG Jg3hA7vdpNvVINL06Ekv7R8VWQ6HnRGhwpga3fVO69iLyCObJW2tgpQQ2/qF3bz8tJ ra+LtffQRU/fA== Date: Sun, 9 Nov 2025 22:53:16 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 12/35] stdlib/gmp.h: Remove unused __gmp_inline macro Message-ID: <3528d2fc604aaea2c2aeae2db3c94606f372784a.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- stdlib/gmp.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/stdlib/gmp.h b/stdlib/gmp.h index 77665ced9d..38bcc9273c 100644 --- a/stdlib/gmp.h +++ b/stdlib/gmp.h @@ -34,8 +34,6 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, see #define __gmp_const #endif -#define __gmp_inline __inline__ - #ifndef _EXTERN_INLINE #define _EXTERN_INLINE __extern_inline #endif From patchwork Sun Nov 9 21:53:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123851 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19F333858C36 for ; Sun, 9 Nov 2025 22:07:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19F333858C36 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uO0YOXG8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id E87A73858C36 for ; Sun, 9 Nov 2025 21:53:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E87A73858C36 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E87A73858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725202; cv=none; b=wvbeLUPzzUpTxYEX98P+e01p2GMA/6lTQ+5lMRhOURpJM4Uj9UZGB7RNNy6vRMuSL6CCIZRWwd102CqSHC+0QcVc2L6iud6sbwJqlgEWP7QS8bifZM8LG3K1uV6nOmS7HpZFscQ7l2sC4eJxAiNkpPiJII0mpj51yepkwNNHoTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725202; c=relaxed/simple; bh=dkNn3fqw1eG2naJ8U1U579lKGIdTFVKWBteJqZ9cbYw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=R6V10gCBm+HjFNNOkKmzAvLdGeEF2pB1lU7dIClvfwFQ70PJ3rUHy8j+/SyNp3NkGFSJtmtmmsHF633LmezNxsB6hxXkoxMipRpF3Q5yzsYghhUXzxlWmrGAzxugnBHPaacFOXJ+2u+xw0l5RITNPoVO/Bx025jvcNsMEa82RFw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E87A73858C36 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 92D0260051 for ; Sun, 9 Nov 2025 21:53:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97123C19421; Sun, 9 Nov 2025 21:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725201; bh=dkNn3fqw1eG2naJ8U1U579lKGIdTFVKWBteJqZ9cbYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uO0YOXG8h/7zFNNNinFOdZ1GLfsFyans0909UVMTfml98VDk+RkUxS1AFggRs928g jAOxIBRcS92a0lK6XWCzfwyJ5+qSmUyhfJAAYMVBr2TpbZ28a4OnKGfYUtHDSyNkbF IMpPnvnrtXVbW7PjEpNRitAb/60DCkcUmzpnC9jouiuAEFWgHL+QQ8b4qqlEbyg3QJ mPJNqn/kpbHyiJ5hwN+tkeNIDFCehrdZ5w+e+nauw1GF7C9ikOCgrvEEjLkyiTomq9 5YCAGx3Bp1YpBocPMedCuD2loDo2kRPNPnpwlG+SQw4KcxL4W7HTt4QAU028hNAA0k J/mnJj/UwB4/A== Date: Sun, 9 Nov 2025 22:53:18 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 13/35] Remove dead code due to _GL_HAVE___TYPEOF__ macro Message-ID: <38d0cd6957919086498a3d598261f3ac90c7edf3.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as 1. Signed-off-by: Alejandro Colomar --- include/intprops.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/include/intprops.h b/include/intprops.h index 149513a1d0..64526a8edf 100644 --- a/include/intprops.h +++ b/include/intprops.h @@ -82,19 +82,11 @@ If this is a problem for you, please let us know how to fix it for your host. This assumption is tested by the intprops-tests module. */ -/* Does the __typeof__ keyword work? This could be done by - 'configure', but for now it's easier to do it by hand. */ -# define _GL_HAVE___TYPEOF__ 1 - -/* Return 1 if the integer type or expression T might be signed. Return 0 - if it is definitely unsigned. T must not be a bit-field expression. +/* Return 1 if the integer type or expression T is signed. Return 0 + if it is unsigned. T must not be a bit-field expression. This macro does not evaluate its argument, and expands to an integer constant expression. */ -#if _GL_HAVE___TYPEOF__ # define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) -#else -# define _GL_SIGNED_TYPE_OR_EXPR(t) 1 -#endif /* Bound on length of the string representing an unsigned integer value representable in B bits. log10 (2.0) < 146/485. The @@ -413,21 +405,10 @@ signed, its type is ST with bounds SMIN..SMAX; otherwise its type is UT with bounds U..UMAX. ST and UT are narrower than int. Return 1 if the result overflows. See above for restrictions. */ -# if _GL_HAVE___TYPEOF__ # define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ (TYPE_SIGNED (__typeof__ (*(r))) \ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax)) -# else -# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \ - (overflow (a, b, smin, smax) \ - ? (overflow (a, b, 0, umax) \ - ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \ - : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \ - : (overflow (a, b, 0, umax) \ - ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \ - : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0))) -# endif # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \ (sizeof *(r) == sizeof (signed char) \ From patchwork Sun Nov 9 21:53:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123850 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F08D7385841B for ; Sun, 9 Nov 2025 22:07:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F08D7385841B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=cvd5EsI4 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id B9244385841C for ; Sun, 9 Nov 2025 21:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9244385841C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B9244385841C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725204; cv=none; b=Zw0y+CzBWlhcyuT4SQLceHNWq6t9u8dyO453uBwV5hi6LCHBZauQ4LDy7b3MRrYl3u5YK2c0Vz5NH/yvzG3cvU84DeKb1kthdVXqm7/6wzuFeHgANBB6YZeSjnyiRN+mDOFLMMkLnDzz+scY1CpaAkWfyxytmzajPVRFX0aHGII= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725204; c=relaxed/simple; bh=QM/9GjIv4qEvr0MIKQpZMj8Y1NZ7oq1v9TEVRna+BVA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=PjgnrAh4ybvg+KH+dBCJC7oKK0Bm53R7/eh7BedqvQdNlYJ6+zZJ8vDTJeHLzkKW0G1jnWz91PdIRAlvu9MmgKJCfPlOEdBpBIebY64oUFSg+vYzRYmOYQWxLwwC84c2pLB8qf3Q9UFcsHR5gb6yDrfplwpbqLQrXww2nxnaAgE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9244385841C Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 19520432C8 for ; Sun, 9 Nov 2025 21:53:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33017C2BC9E; Sun, 9 Nov 2025 21:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725203; bh=QM/9GjIv4qEvr0MIKQpZMj8Y1NZ7oq1v9TEVRna+BVA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cvd5EsI4Xcc0kqBqu3gUD6HH845ILUR692YvhoyZbzsqxwIlnX83yCk7WBj1UEj5t RH8VJ00MILU76ww6glFGmBSolqBaTML4C1iGwR+Oz0sOJwm0Eebr77af4HMSZUQgXv PllBM580Ei0LidoXBQcS4Dzfo86P6//LUfxrBl3Jt3rCXuEVmdMdUWazeN+ORKp413 jb/g7JdHEye1oRt6O/HZZEef2gYYtZnnxo2A3LvXX6HRGZhK0HwZZvQ0Yf5TM9ilX3 KA/nzMKJ3ZZPtlhf3VfZIyUmRF121CpoGGXkgzjyiuHWrSF0C057pg1QqCynCeGVt1 oIq01KGyp4Eig== Date: Sun, 9 Nov 2025 22:53:21 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 14/35] posix/regex.h: Remove _Restrict_ macro Message-ID: <131c9cba132392ee5da7652202da85207ff3f976.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as __restrict. (Unless previously defined, but that shouldn't happen.) Signed-off-by: Alejandro Colomar --- posix/regex.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/posix/regex.h b/posix/regex.h index 4e4dcb8515..bd1d941f38 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -636,15 +636,6 @@ extern char *re_comp (const char *); extern int re_exec (const char *); #endif -/* For plain 'restrict', use glibc's __restrict if defined. - Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have - "restrict", and "configure" may have defined "restrict". - Other compilers use __restrict, __restrict__, and _Restrict, and - 'configure' might #define 'restrict' to those words, so pick a - different name. */ -#ifndef _Restrict_ -# define _Restrict_ __restrict -#endif /* For the ISO C99 syntax array_name[restrict] use glibc's __restrict_arr if available. @@ -655,7 +646,7 @@ extern int re_exec (const char *); # define _Restrict_arr_ __restrict_arr # else # if !defined __cplusplus -# define _Restrict_arr_ _Restrict_ +# define _Restrict_arr_ __restrict # else # define _Restrict_arr_ # endif @@ -663,18 +654,18 @@ extern int re_exec (const char *); #endif /* POSIX compatibility. */ -extern int regcomp (regex_t *_Restrict_ __preg, - const char *_Restrict_ __pattern, +extern int regcomp (regex_t *__restrict __preg, + const char *__restrict __pattern, int __cflags); -extern int regexec (const regex_t *_Restrict_ __preg, - const char *_Restrict_ __String, size_t __nmatch, +extern int regexec (const regex_t *__restrict __preg, + const char *__restrict __String, size_t __nmatch, regmatch_t __pmatch[_Restrict_arr_ _REGEX_NELTS (__nmatch)], int __eflags); -extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, - char *_Restrict_ __errbuf, size_t __errbuf_size) +extern size_t regerror (int __errcode, const regex_t *__restrict __preg, + char *__restrict __errbuf, size_t __errbuf_size) _Attr_access_ ((__write_only__, 3, 4)); extern void regfree (regex_t *__preg); From patchwork Sun Nov 9 21:53:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123856 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE13B3858D33 for ; Sun, 9 Nov 2025 22:12:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE13B3858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=VHxKb3CU X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 5EAD83858C56 for ; Sun, 9 Nov 2025 21:53:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5EAD83858C56 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5EAD83858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725207; cv=none; b=KnFEfgL8lILGN3jHQxqOINkCyeqf5+y04yDUF8L9jDd+sz4lHtqVidNGhvjadfsjenU8IlrpySt8YU7PFcGRKme9Y1Oitjmh0FDd2pOiQgFm8jhzfEBBth5Dh8Cl1m8/13xXLBZ0c7VYgDgG/iq2y5VyqTOVOK3ApyfbBOsA6s8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725207; c=relaxed/simple; bh=2gfOTCeT8bou58k4dTdax2rrnxZSJQhHHD216U2Advg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=eyFyIMUsNCp5uVt5jzRN7Z67redJooPmLvnTFH9Za1x6u6R5whdpOPfJJiO3VNwSE9STK5o8x6YoSi2drcPZIWNwQwIkbbgXpnMvYOFoWHLcHexMwjuxF5XE9eEYlW7ASobC8TvUYqXOlCsiiMbxw6WsmEGz1LvxtnsBlgm5uW0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EAD83858C56 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id C98004369A for ; Sun, 9 Nov 2025 21:53:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07BE3C4CEFB; Sun, 9 Nov 2025 21:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725206; bh=2gfOTCeT8bou58k4dTdax2rrnxZSJQhHHD216U2Advg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VHxKb3CUQkjjKhfFRLaOy7zxe3TVpn4Sm4WkihMEouCtCVKumL4+bZPoOJ4EvGgNS LjsihSrXomoVWLEuQ9GmV0t7JPD2Y5jEJ3QW24vzfqpD2lGOyPjkM2r2lTPX+BLVhX xskdSSXB4z91xDimFEmbinAqCP+rt40LJMn1tYJUyVrlFUhURrSx1mbvBNslUEqQHl hco4FfJXXynvi2Vle4n9gjG4exUX3elIdIwegPTCF3C1cKQihzmmonptsjFCOQylAX vjz4stj+GkhN/pgXd5lC8NlczhsleuBZN9Yso6XhueJrfLrQPFUGR3IyhCyJZS8Q6f YA+M/ZPhXVP5A== Date: Sun, 9 Nov 2025 22:53:24 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 15/35] posix/regex.h: Use __restrict_arr and remove _Restrict_arr_ Message-ID: <4e5a815e49270ed873481344fca9e949d57eac40.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- posix/regex.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/posix/regex.h b/posix/regex.h index bd1d941f38..f33368562a 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -638,18 +638,12 @@ extern int re_exec (const char *); /* For the ISO C99 syntax array_name[restrict] - use glibc's __restrict_arr if available. - Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode). - Other ISO C99 compilers support it as well. */ -#ifndef _Restrict_arr_ -# ifdef __restrict_arr -# define _Restrict_arr_ __restrict_arr + use glibc's __restrict_arr if available. */ +#ifndef __restrict_arr +# if defined __cplusplus +# define __restrict_arr # else -# if !defined __cplusplus -# define _Restrict_arr_ __restrict -# else -# define _Restrict_arr_ -# endif +# define __restrict_arr __restrict # endif #endif @@ -660,7 +654,7 @@ extern int regcomp (regex_t *__restrict __preg, extern int regexec (const regex_t *__restrict __preg, const char *__restrict __String, size_t __nmatch, - regmatch_t __pmatch[_Restrict_arr_ + regmatch_t __pmatch[__restrict_arr _REGEX_NELTS (__nmatch)], int __eflags); From patchwork Sun Nov 9 21:53:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123857 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C15B53858408 for ; Sun, 9 Nov 2025 22:12:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C15B53858408 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SKiBTuvK X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 0C4B83858C39 for ; Sun, 9 Nov 2025 21:53:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C4B83858C39 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0C4B83858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725210; cv=none; b=ApLh5TtpXelaXsJ+yyH+KqBCkU8LzLtWpqVMQgHgk2U8TEjaLgJhYX+EtrrThJ6C42Hm6QCp3ZL2p9G+7e0U1jNI9useTceWH2W6XnTyls62jxl8Oa0os9XIxRAF3g/reCe81ZfNz6Xg4NknR4/LE4z/yyE8qIpfIGEyMDBNy+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725210; c=relaxed/simple; bh=XgBFAjVt8/xr2r0ObZ7IQ+N/8rnGiqmV2bskuRCMfoI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=YBXX1+HxtgerJRRBb8G+jPYbmlC6MhEa0A+suXLh20j+Rdp4D4YUAo+SfPD73/nltjxGk7iFi7VwbBU9JTDe4SYN75F1vrK/SOOGlLK8eZ8l9ayJDBaFsTITyMniYt0dhBC0OANJ7nTOh2+lvrM7wuSgKd9IC15AthblJUUsxVY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C4B83858C39 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A8DD360007 for ; Sun, 9 Nov 2025 21:53:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6FFFC4CEF8; Sun, 9 Nov 2025 21:53:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725209; bh=XgBFAjVt8/xr2r0ObZ7IQ+N/8rnGiqmV2bskuRCMfoI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SKiBTuvKqvEvGNlPMbYwSVlEy3egd8SAJl/+dvDCR3Ovg9ciPcgl2o/4Vyu0QuqgE DWtU6kBMXTezpgZqs86r7ut8ZyUXgBN9OYeH66eRahfPOwfPy322obXbNbiagiroxa INKOMSwe2LTHpuyWKXJvBa4HpEZXEeKWYZYenpaGhZAyUFbPqSv2mA/cCFy9Obb/OF RykjddYGyhph9hBeb3Lhx+I38DzmeYyYUw+tNE2soX3IBGXT3QM2BW+aIvGyhNXdt6 c9qFXOOGfy6AFNZs/V4SB0ZwZIsSxGYa5yufQP/2/OxkWXEJJdTq2JhFd6BfLCxldh jMRnyQimZ91gg== Date: Sun, 9 Nov 2025 22:53:26 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 16/35] Assume that Clang is at least Clang 4 Message-ID: <9e2b5dc7c888e96f8e6bb9c9d87ebfaa07b9b131.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- math/math.h | 12 ++++++------ misc/sys/cdefs.h | 15 +++++---------- string/bits/string_fortified.h | 2 +- string/string.h | 2 +- sysdeps/x86/bits/floatn.h | 4 ++-- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/math/math.h b/math/math.h index 8113e6784c..6e6b82fab1 100644 --- a/math/math.h +++ b/math/math.h @@ -898,7 +898,7 @@ enum /* Return number of classification appropriate for X. */ # if ((__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \ - || __glibc_clang_prereq (2,8)) \ + || defined(__clang__)) \ && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus) /* The check for __cplusplus allows the use of the builtin, even when optimization for size is on. This is provided for @@ -913,7 +913,7 @@ enum # endif /* Return nonzero value if sign of X is negative. */ -# if __GNUC_PREREQ (6,0) || __glibc_clang_prereq (3,3) +# if __GNUC_PREREQ (6,0) || defined(__clang__) # define signbit(x) __builtin_signbit (x) # elif defined __cplusplus /* In C++ mode, __MATH_TG cannot be used, because it relies on @@ -930,7 +930,7 @@ enum /* Return nonzero value if X is not +-Inf or NaN. */ # if (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \ - || __glibc_clang_prereq (2,8) + || defined(__clang__) # define isfinite(x) __builtin_isfinite (x) # else # define isfinite(x) __MATH_TG ((x), __finite, (x)) @@ -938,7 +938,7 @@ enum /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */ # if (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \ - || __glibc_clang_prereq (2,8) + || defined(__clang__) # define isnormal(x) __builtin_isnormal (x) # else # define isnormal(x) (fpclassify (x) == FP_NORMAL) @@ -947,7 +947,7 @@ enum /* Return nonzero value if X is a NaN. We could use `fpclassify' but we already have this functions `__isnan' and it is faster. */ # if (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \ - || __glibc_clang_prereq (2,8) + || defined(__clang__) # define isnan(x) __builtin_isnan (x) # else # define isnan(x) __MATH_TG ((x), __isnan, (x)) @@ -966,7 +966,7 @@ enum (__builtin_types_compatible_p (__typeof (x), _Float128) \ ? __isinff128 (x) : __builtin_isinf_sign (x)) # elif (__GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__) \ - || __glibc_clang_prereq (3,7) + || defined(__clang__) # define isinf(x) __builtin_isinf_sign (x) # else # define isinf(x) __MATH_TG ((x), __isinf, (x)) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 12b424e85c..d28af8b30a 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -39,9 +39,7 @@ #if defined __has_attribute && __has_attribute (...) even though they do not need to evaluate the right-hand side of the &&. Similarly for __has_builtin, etc. */ -#if (defined __has_attribute \ - && (!defined __clang_minor__ \ - || 3 < __clang_major__ + (5 <= __clang_minor__))) +#if (defined __has_attribute) # define __glibc_has_attribute(attr) __has_attribute (attr) #else # define __glibc_has_attribute(attr) 0 @@ -126,9 +124,7 @@ #endif -/* The overloadable attribute was added on clang 2.6. */ -#if defined __clang_major__ \ - && (__clang_major__ + (__clang_minor__ >= 6) > 2) +#if defined __clang__ # define __attribute_overloadable__ __attribute__((__overloadable__)) #else # define __attribute_overloadable__ @@ -530,8 +526,7 @@ #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && !(__GNUC_PREREQ (4,7) \ - || (3 < __clang_major__ + (5 <= __clang_minor__)))) + && !(__GNUC_PREREQ (4,7) || defined(__clang__))) # define _Noreturn __attribute__ ((__noreturn__)) #endif @@ -556,7 +551,7 @@ #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ + && (!(__GNUC_PREREQ (4, 6) || defined(__clang__)) \ || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ @@ -642,7 +637,7 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf Note: MESSAGE must be a _single_ string; concatenation of string literals is not supported. */ -#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) +#if __GNUC_PREREQ (4,8) || defined(__clang__) # define __glibc_macro_warning1(message) _Pragma (#message) # define __glibc_macro_warning(message) \ __glibc_macro_warning1 (GCC warning message) diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h index 9916e17aa0..c7f7cb0e35 100644 --- a/string/bits/string_fortified.h +++ b/string/bits/string_fortified.h @@ -114,7 +114,7 @@ __NTH (strncpy (__fortify_clang_overload_arg (char *, __restrict, __dest), } #ifdef __USE_XOPEN2K8 -# if __GNUC_PREREQ (4, 7) || __glibc_clang_prereq (2, 6) +# if __GNUC_PREREQ (4, 7) || defined(__clang__) __fortify_function __attribute_overloadable__ char * __NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), const char *__src, size_t __n)) diff --git a/string/string.h b/string/string.h index 54faf8ed8e..03987fa352 100644 --- a/string/string.h +++ b/string/string.h @@ -34,7 +34,7 @@ __BEGIN_DECLS /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && (__GNUC_PREREQ (4, 4) \ - || __glibc_clang_prereq (3, 5)) + || defined(__clang__)) # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h index 4674165bd7..3407874096 100644 --- a/sysdeps/x86/bits/floatn.h +++ b/sysdeps/x86/bits/floatn.h @@ -31,7 +31,7 @@ #if (defined __x86_64__ \ ? __GNUC_PREREQ (4, 3) \ : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \ - || (__glibc_clang_prereq (3, 9) \ + || (defined(__clang__) \ && (!defined __INTEL_LLVM_COMPILER \ || !defined SYCL_LANGUAGE_VERSION)) # define __HAVE_FLOAT128 1 @@ -93,7 +93,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); /* The type _Float128 exists only since GCC 7.0. */ # if !__GNUC_PREREQ (7, 0) \ || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) \ - || __glibc_clang_prereq (3, 9) + || defined(__clang__) typedef __float128 _Float128; # endif From patchwork Sun Nov 9 21:53:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123847 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1EDB4385840E for ; Sun, 9 Nov 2025 22:04:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EDB4385840E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qPjT9U8V X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id AF80E3858402 for ; Sun, 9 Nov 2025 21:53:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF80E3858402 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF80E3858402 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725212; cv=none; b=iIDRNTHB1JM2uiTcuFDlp/9L5n64TR7fQ+ZFf5VDywrjhtnCr45vSiZQJFjBtE0Ycj+B+raQE0OKD2Z4RP8VBviezqNsHfqw0ptzcP2IX+d6+ezJ/37aHqPzVxGHd5UCDKtK97uttupRv/whGQsyjAAK0Wj8FaTpOSfqbhsSX08= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725212; c=relaxed/simple; bh=xU51HDCK6E+iy4WhigK5aAK0ANxuxVZ+fKh2G67mUWI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=BZGKkaa7xF3B3JBZfCEKI4KqRIHEbLx2sIDmv0slzwmEYO3rd3OzsThZYU/6I7IfU4H/rgMGTn9H2rMyQv50w/LCgisL1iyOHKWRJd5MW0OQOOkDhno5cLVSZ+zt32LmrxUCAZ9V6HCt/ZQVQCIJaWgkeKDe7AkJdpwxkifxD74= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF80E3858402 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2036B444AE for ; Sun, 9 Nov 2025 21:53:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52FF9C19424; Sun, 9 Nov 2025 21:53:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725212; bh=xU51HDCK6E+iy4WhigK5aAK0ANxuxVZ+fKh2G67mUWI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qPjT9U8V3JfBV+0gLeYWaCJxnjvIGfiZNqBAk/swnfPRv4bzqk5+KIqw38oYSFoqV SpeTX4T3QvsxuZCFxEUnaGmeV385SPetGMX+E+ZwUBIo8q4DEni5Ivid8GrtIs0Waa cF4X704MgwqFdku1uX8RBYd1GT4+J+OeiRalQ9bOsMg9swFuNa3l9nWuXf+bKpKXLf Iqhj58Jorz8yEGFk6wyo0UluO+hUO+tq5jCsVost6bWyZJ5XQAXA9k8TpWCUWTwCxv AA8U62qRBLe7+mdxylL8jMlAA5DUWY6eL76AA4xQ4YoHNlRaB4sgty90CN82jHp3N2 hYUebs09E1CQA== Date: Sun, 9 Nov 2025 22:53:29 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 17/35] Assume that GCC is at least GCC 5 Message-ID: <6da6af3c366b2fc751d445c5fc62116809f02e7c.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 13 +------------ string/bits/string_fortified.h | 19 ------------------- string/string.h | 3 +-- sysdeps/x86/bits/floatn.h | 7 +------ 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index d28af8b30a..8f565acda1 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -524,12 +524,6 @@ # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) -#if (!defined _Noreturn \ - && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && !(__GNUC_PREREQ (4,7) || defined(__clang__))) -# define _Noreturn __attribute__ ((__noreturn__)) -#endif - #if __GNUC_PREREQ (8, 0) /* Describes a char array whose address can safely be passed as the first argument to strncpy and strncat, as the char array is not necessarily @@ -551,8 +545,7 @@ #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && (!(__GNUC_PREREQ (4, 6) || defined(__clang__)) \ - || defined __STRICT_ANSI__)) + && defined __STRICT_ANSI__) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] @@ -637,13 +630,9 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf Note: MESSAGE must be a _single_ string; concatenation of string literals is not supported. */ -#if __GNUC_PREREQ (4,8) || defined(__clang__) # define __glibc_macro_warning1(message) _Pragma (#message) # define __glibc_macro_warning(message) \ __glibc_macro_warning1 (GCC warning message) -#else -# define __glibc_macro_warning(msg) -#endif /* Generic selection (ISO C11) is a C-only feature, available in GCC since version 4.9. Previous versions do not provide generic diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h index c7f7cb0e35..88eb2510cd 100644 --- a/string/bits/string_fortified.h +++ b/string/bits/string_fortified.h @@ -114,7 +114,6 @@ __NTH (strncpy (__fortify_clang_overload_arg (char *, __restrict, __dest), } #ifdef __USE_XOPEN2K8 -# if __GNUC_PREREQ (4, 7) || defined(__clang__) __fortify_function __attribute_overloadable__ char * __NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), const char *__src, size_t __n)) @@ -123,24 +122,6 @@ __NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), return __builtin___stpncpy_chk (__dest, __src, __n, __glibc_objsize (__dest)); } -# else -extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, - size_t __destlen) __THROW - __fortified_attr_access (__write_only__, 1, 3) - __attr_access ((__read_only__, 2)); -extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, - size_t __n), stpncpy); - -__fortify_function __attribute_overloadable__ char * -__NTH (stpncpy (__fortify_clang_overload_arg (char *, ,__dest), - const char *__src, size_t __n)) -{ - if (__bos (__dest) != (size_t) -1 - && (!__builtin_constant_p (__n) || __n > __bos (__dest))) - return __stpncpy_chk (__dest, __src, __n, __bos (__dest)); - return __stpncpy_alias (__dest, __src, __n); -} -# endif #endif diff --git a/string/string.h b/string/string.h index 03987fa352..a226c7808d 100644 --- a/string/string.h +++ b/string/string.h @@ -33,8 +33,7 @@ __BEGIN_DECLS #include /* Tell the caller that we provide correct C++ prototypes. */ -#if defined __cplusplus && (__GNUC_PREREQ (4, 4) \ - || defined(__clang__)) +#if defined __cplusplus # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif diff --git a/sysdeps/x86/bits/floatn.h b/sysdeps/x86/bits/floatn.h index 3407874096..1099ffbb5a 100644 --- a/sysdeps/x86/bits/floatn.h +++ b/sysdeps/x86/bits/floatn.h @@ -28,12 +28,7 @@ support, for x86_64 and x86. Intel SYCL compiler doesn't support _Float128: https://github.com/intel/llvm/issues/16903 */ -#if (defined __x86_64__ \ - ? __GNUC_PREREQ (4, 3) \ - : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \ - || (defined(__clang__) \ - && (!defined __INTEL_LLVM_COMPILER \ - || !defined SYCL_LANGUAGE_VERSION)) +#if (!defined __INTEL_LLVM_COMPILER || !defined SYCL_LANGUAGE_VERSION) # define __HAVE_FLOAT128 1 #else # define __HAVE_FLOAT128 0 From patchwork Sun Nov 9 21:53:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123860 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCC773858408 for ; Sun, 9 Nov 2025 22:16:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCC773858408 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SPGm5XWT X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 66E8C3858412 for ; Sun, 9 Nov 2025 21:53:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66E8C3858412 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 66E8C3858412 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725215; cv=none; b=HwJ0fcB2Pp12RRkLG6YbtF0hEdgfAYdpzPwDVgb7as5g6IyQ5Kw0TIvcOHBMt9xyfSmBbPJhOz1Nd4HAHwWTwrREPkFGuxopvEC7EVJMjMgY9tGxvRrAiuw7vhmUSJmoU2oJO9Ws8V8DOLjrz6Gi5rHBQuRKwDQ8OfDqJpUzDPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725215; c=relaxed/simple; bh=lvV5V1kO/VCSfYtiaHEH+muFcDUkNxgkfwkIYFjY0RU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=nzSC8wOGvAFEdta34hJ+hZGIjVIhvEdW1mREMeQcasjLFsFqiGothnnNbZBYWxqWSdfybZk7hF/JBxeB1U2LFPY7IZMTsBWi7RSlzHgUz3Vlo0VWavX3xJkqNIDEz34Q1UV3CWoRmyxL2xTp1vZE/Yx1Gu3mnhpoPt2GZejqSJA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66E8C3858412 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id C087B444FC for ; Sun, 9 Nov 2025 21:53:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01B21C116B1; Sun, 9 Nov 2025 21:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725214; bh=lvV5V1kO/VCSfYtiaHEH+muFcDUkNxgkfwkIYFjY0RU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SPGm5XWTkly+YhLzBkRY/c2deRP4/sMPFwwrK9KdtPH1d0hifXvU3z2zN5SNEir+C 8hb5WcCRPhTVnSq5YgehfpBAkLEcqsKKBllq0726opjIdM27E0Kj54MH9R8CqmKKC8 tGiw1kb+xPs7vI+tKPv5G3RA+4veJvkqAr9UTlz2RY5EAnFZsw3lCBK+AHh1qOIsHt ptTCd/QDAW3QFQhoatiD7PgQnHp+5/OWK+4OdE1rTTRaCQm3rbQhHoZOLUS1sx3PT1 5Hc/aJY4qHkxMNBFpcNiUJDMKvLMEif2uBAAW7e7+xlu1tOn/IPd10xS5xLbFnunGL /MowSTHm09qGw== Date: Sun, 9 Nov 2025 22:53:32 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 18/35] Assume _Generic(3) is supported by the compiler Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. I don't know when Clang added support for _Generic(3), but I see it being supported in Clang 3.3: llvm.git 587b34850493 (2013-02-12; "Perform placeholder conversions on the controller of a _Generic expression.") $ git describe --contains 587b34850493 llvmorg-3.3.0-rc1~7^2~5659 Signed-off-by: Alejandro Colomar --- timezone/private.h | 22 +--------------------- timezone/zdump.c | 6 ++---- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/timezone/private.h b/timezone/private.h index fcd71a044d..4f430dba2c 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -72,19 +72,6 @@ ** You can override these in your C compiler options, e.g. '-DHAVE_GETTEXT=1'. */ -#if !defined HAVE__GENERIC && defined __has_extension -# if !__has_extension(c_generic_selections) -# define HAVE__GENERIC 0 -# endif -#endif -/* _Generic is buggy in pre-4.9 GCC. */ -#if !defined HAVE__GENERIC && !defined __STRICT_ANSI__ -# define HAVE__GENERIC (4 < __GNUC__ + (9 <= __GNUC_MINOR__)) -#endif -#ifndef HAVE__GENERIC -# define HAVE__GENERIC (201112 <= __STDC_VERSION__) -#endif - #if !defined HAVE_GETTEXT && defined __has_include # if __has_include() # define HAVE_GETTEXT true @@ -844,9 +831,7 @@ ATTRIBUTE_PURE time_t time2posix_z(timezone_t, time_t); any portability problems occur only when compiling .c files that use the macros, which is safer for applications that need only zdump and zic. This implementation assumes no padding if time_t is signed and - either the compiler lacks support for _Generic or time_t is not one - of the standard signed integer types. */ -#if HAVE__GENERIC + time_t is not one of the standard signed integer types. */ # define TIME_T_MIN \ _Generic((time_t) 0, \ signed char: SCHAR_MIN, short: SHRT_MIN, \ @@ -864,11 +849,6 @@ enum { SIGNED_PADDING_CHECK_NEEDED signed char: false, short: false, int: false, long: false, long long: false, default: true) }; -#else -# define TIME_T_MIN TIME_T_MIN_NO_PADDING -# define TIME_T_MAX TIME_T_MAX_NO_PADDING -enum { SIGNED_PADDING_CHECK_NEEDED = true }; -#endif /* Try to check the padding assumptions. Although TIME_T_MAX and the following check can both have undefined behavior on oddball platforms due to shifts exceeding widths of signed integers, these diff --git a/timezone/zdump.c b/timezone/zdump.c index e817873337..3c5f72c665 100644 --- a/timezone/zdump.c +++ b/timezone/zdump.c @@ -1178,14 +1178,12 @@ abbr(struct tm const *tmp) } /* -** The code below can fail on certain theoretical systems; -** it works on all known real-world systems as of 2022-01-25. +** The code below can fail on certain theoretical systems. */ static const char * tformat(void) { -#if HAVE__GENERIC /* C11-style _Generic is more likely to return the correct format when distinct types have the same size. */ char const *fmt = @@ -1201,7 +1199,7 @@ tformat(void) default: NULL); if (fmt) return fmt; -#endif + if (0 > (time_t) -1) { /* signed */ if (sizeof(time_t) == sizeof(intmax_t)) return "%"PRIdMAX; From patchwork Sun Nov 9 21:53:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123855 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 664BB3858D33 for ; Sun, 9 Nov 2025 22:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 664BB3858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eAq6+f/W X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 03B183858C31 for ; Sun, 9 Nov 2025 21:53:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03B183858C31 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03B183858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725218; cv=none; b=E/MMw1+KbxMw++FUCY09sVgeI7bwymmZU/rr7M3ZbNB2Ca9zVDnzZft5ghuFubqU3phkAOc+DtlDQlqBoy5nS6VsZp+YrSYlwXh/zPkh4xRcxbpWe7ATVjXinxK7JqoRzdPmF3f6lbqF/r82rS1lVhrb3oD+pihQDO69imozaDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725218; c=relaxed/simple; bh=7ZzKgS1nTEdKZ7xJ0tduhGvlkd4d7i8pwxFcdOHvDvs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Y/xBx1qHJ5Ey/lehpXA5N8pjTZ165qCq3SY6BCXlGBudqKkG5tX29hppbp2R4wwUdmNezPOIsEZWltEnR+RjqtVI00u0CYYTMWVGt9lXlRQokVqA6s5ukd0zmbRK3RtJR0+BYYs8gofOFONOLeOP4iupN2+9FXGlRgAGZ5qDES8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03B183858C31 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A22B460051 for ; Sun, 9 Nov 2025 21:53:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EEB1C116B1; Sun, 9 Nov 2025 21:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725217; bh=7ZzKgS1nTEdKZ7xJ0tduhGvlkd4d7i8pwxFcdOHvDvs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eAq6+f/W/UnJEOwmdgcFagODOICxodstbTn+WcykQO8m2LyIeQ5GHFU+b8JqAcVUA BI2Ssq16ar2gbUjghvrGhPiOfAXPJVIRhTMEH3uHY9Npcn64G1aMI0WilXUWXPbzVq B/XnhMIxC05ALNkNKakeYQByg22Y/t68JFlASXD+UDKhMMJdehwTeeGQdi5yH/KDvo RXuIOZmm5b81IP1wzoBxZVljNpC72JYTOhuXTutSZF0NjH2tyAIfIkJnCLffdPxYLA 8rV5Mxj+FtrKe6JLzJgx8WbvXSWFvU5nBOulkMtpTmPsxz5Ju3nP8Wk6hUru9i5g9T AAWhIxh1aT63w== Date: Sun, 9 Nov 2025 22:53:34 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 19/35] Assume __has_builtin(__builtin_unreachable) Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for this builtin in Clang 2.7: llvm.git bf20638966e2 (2009-09-21; "Implement __builtin_unreachable(), a GCC 4.5 extension.") $ git describe --contains bf20638966e2 llvmorg-2.7.0~11211 Signed-off-by: Alejandro Colomar --- soft-fp/soft-fp.h | 4 ---- timezone/private.h | 9 --------- 2 files changed, 13 deletions(-) diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index 3b8d7e2265..a949962a63 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -49,11 +49,7 @@ /* For unreachable default cases in switch statements over bitwise OR of FP_CLS_* values. */ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) # define _FP_UNREACHABLE __builtin_unreachable () -#else -# define _FP_UNREACHABLE abort () -#endif #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) diff --git a/timezone/private.h b/timezone/private.h index 4f430dba2c..838cfa76f1 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -904,16 +904,7 @@ time_t timeoff(struct tm *, long); # undef unreachable # define unreachable() abort() #elif !defined unreachable -# ifdef __has_builtin -# if __has_builtin(__builtin_unreachable) -# define unreachable() __builtin_unreachable() -# endif -# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) # define unreachable() __builtin_unreachable() -# endif -# ifndef unreachable -# define unreachable() ((void) 0) -# endif #endif /* From patchwork Sun Nov 9 21:53:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123842 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DFDF3858419 for ; Sun, 9 Nov 2025 22:00:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DFDF3858419 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=CSHuJ69B X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id B6B6D385840D for ; Sun, 9 Nov 2025 21:53:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6B6D385840D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B6B6D385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725220; cv=none; b=kVzn98cZCmyGfX9QWrh26Pf7w3w4LWp0Ryua7X8H2HOv+PqJOjjgQRLgZtM6Ofzti1EnRZelH4alyqV4KRPMcPk43Y8/YEg+DxhHnNiyc4pn4MEeTp46vKayE69hTNU90eF7MoAaRUFtiHbVY378lA4NvV5GLmr7atZ6BPFlxkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725220; c=relaxed/simple; bh=Xg2SA2wqE1gCjkZAOp8IM78NOYUw/Zhbmi3uz6KzZWU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=wVQpjn026b+XPPBd3qTD/YZ9HVavI6f1jr7ZH5tKSkKjFmjY2b3+hzuiytEkaviJ7I66N41ClcIoPXZDWqV/qCIe/o7rMtXRNAP8zEQqKeCDQvoAtr6CGvDI/Y+gEAgVGqM7MpKwYzyLRtBhWdJGee9jxu3HiJC48byNlVvDWps= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6B6D385840D Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 1C6E64369A for ; Sun, 9 Nov 2025 21:53:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5073EC116B1; Sun, 9 Nov 2025 21:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725220; bh=Xg2SA2wqE1gCjkZAOp8IM78NOYUw/Zhbmi3uz6KzZWU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CSHuJ69BQjcQksuhjm8mIJaYFUJ5LfYDRhIl4EkafBTc3tgBNZmSRssKHkyZYwxHd YsHyNZEASgCoxDWpZApqr1MvKGskXkV1ZovDz4xNFVITgVDOBhJ+bAWqDDLmkxomol 1XSKEcn7AtYQHN0+RpAZDABayT/PTEdMwVepKCD1nRpuS+rqp0pQnls7waVZ8HMCPL DIrC4XxZOekkEJ9Y06VmOoVkb2R08cQ6eubKiKWHoTg40JOYT5V0OhomHkt+Aff/89 VhDRW3kZ3LQh2cNemkLPR/DROkorDmclui50HgF4iopwxXrJW60oFzSN2669pszfFQ 9bNCkCs9s7QZA== Date: Sun, 9 Nov 2025 22:53:37 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 20/35] Assume #pragma GCC diagnostic is supported by the compiler Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for this pragma in Clang 2.6: llvm.git 504af1177d9c (2009-04-19; "implement "#pragma GCC diagnostic".") $ git describe --contains 504af1177d9c llvmorg-2.6.0~8194 Also, Clang added support for -Wcast-qual in Clang 3.6: llvm.git d5178014938d (2014-11-21; "Implement -Wcast-qual, fixing #13772.") $ git describe --contains d5178014938d llvmorg-3.6.0-rc1~3098 Also, Clang added support for -Wvla in Clang 2.8: llvm.git 4b636a70d93d (2010-05-23; "Put the VLA-is-an-extension warning into its own warning group (-Wvla) so that it can be selectively enabled/disabled.") $ git describe --contains 4b636a70d93d llvmorg-2.8.0-rc0~6649 Signed-off-by: Alejandro Colomar --- bits/stdlib-bsearch.h | 4 ---- posix/regex.c | 2 +- posix/regex.h | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bits/stdlib-bsearch.h b/bits/stdlib-bsearch.h index 5ca67857e5..aa3ea53b21 100644 --- a/bits/stdlib-bsearch.h +++ b/bits/stdlib-bsearch.h @@ -29,14 +29,10 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __comparison = (*__compar) (__key, __p); if (__comparison == 0) { -#if __GNUC_PREREQ(4, 6) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wcast-qual" -#endif return (void *) __p; -#if __GNUC_PREREQ(4, 6) # pragma GCC diagnostic pop -#endif } if (__comparison > 0) { diff --git a/posix/regex.c b/posix/regex.c index f5f6552670..9655785953 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -24,8 +24,8 @@ # if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" -# pragma GCC diagnostic ignored "-Wvla" # endif +# pragma GCC diagnostic ignored "-Wvla" #endif /* Make sure no one compiles this code with a C++ compiler. */ diff --git a/posix/regex.h b/posix/regex.h index f33368562a..cd6596c0f7 100644 --- a/posix/regex.h +++ b/posix/regex.h @@ -531,10 +531,8 @@ typedef struct # endif #endif -#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wvla" -#endif #ifndef _Attr_access_ # ifdef __attr_access @@ -664,9 +662,7 @@ extern size_t regerror (int __errcode, const regex_t *__restrict __preg, extern void regfree (regex_t *__preg); -#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # pragma GCC diagnostic pop -#endif #ifdef __cplusplus } From patchwork Sun Nov 9 21:53:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123849 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 418653858402 for ; Sun, 9 Nov 2025 22:04:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 418653858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=GMbWbIN5 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 4B2883858421 for ; Sun, 9 Nov 2025 21:53:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B2883858421 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4B2883858421 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725223; cv=none; b=pXhwglaUbVu7Y834iplb5fJZ0dgnuQNap5iljjWMjC79V1dQsjBWi8QPUZcH6xIeMpyjD6FyFLH7fbFcxuRgmpHOVEPaPBqKBLbo4ktPoYOJhMP5XomJYaY2HmNQ2U7Mj+v6DF5htdaHso23+IfQvYicXOdHL20t4DXDHCbxkuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725223; c=relaxed/simple; bh=WR1NOjmIvhLNlowFoC0reNRdqcxVSqpE6WElJuHSymI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=j+lusdRIffPeokDhAAZs4DMcdJ6sLUTPbboorA0PT5VPhTNgadsxyQ1XlnfCbAy2lz3WhPczMnja6PvncDtFPk7WrWSfgaqO/UYE6z0CC7IlSUcCxOhVrj/Hl1slEvUeJJQwGgzTGdpPHd2HDZHaNLks9qcvVRN4vAxtmNfe5Ms= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B2883858421 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id DEBAB60051 for ; Sun, 9 Nov 2025 21:53:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2478C4CEF7; Sun, 9 Nov 2025 21:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725222; bh=WR1NOjmIvhLNlowFoC0reNRdqcxVSqpE6WElJuHSymI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GMbWbIN5o6Ejmtw8Im2PYy/7C3ZIcvhKAIGsa/boo+hR9FyfqftlTH0fzxN15uLBA 2AuO1C9uSy3ahCkDz2NPp3t6bmL11/9VFtzUH1CT0m98ZpZXBNZ46a+Y5bskklLeDu yGKMi5pMeBITaYkhjyed8fitwlEVwymjVG4ifEovKMXKhTBIWMVagETUazCpQmqFik e4lgnApslGUTct1+SQzLBe+lQaBtt+9S1+rf1LIRil/E6fTZzOXqkgVLELCeSmBRat hRNOwQYaqA7P0mAdbv47EtMTrLFCReROzyKwMXBaDghJxYcQMUQXj7OWugahPOGkdW xES/ZnaCTHgCQ== Date: Sun, 9 Nov 2025 22:53:40 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 21/35] In tests, assume GCC 5 or later or compatible Message-ID: <84c71cbdef5fb1ef484ba7e5de21865b47512f67.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org In theory, some of these features might not be supported by Clang 4 (which is the minimum Clang version we assume). However, since these are tests, it's safe to assume that most (if not all) of them are supported, or at least that it won't be worse than not testing them at all. Signed-off-by: Alejandro Colomar --- assert/tst-assert-c++.cc | 10 ---------- elf/tst-stringtable.c | 10 ---------- io/tst-utimensat-skeleton.c | 4 ---- misc/tst-fd_to_filename.c | 10 ---------- signal/tst-minsigstksz-1.c | 2 +- string/tester.c | 2 -- sysdeps/unix/sysv/linux/tst-getdents64.c | 7 ------- sysdeps/x86/tst-cpu-features-supports.c | 10 ---------- time/tst-ctime.c | 10 ---------- time/tst-difftime.c | 10 ---------- time/tst-mktime4.c | 10 ---------- 11 files changed, 1 insertion(+), 84 deletions(-) diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc index ab404ef0f9..154a6c2dd1 100644 --- a/assert/tst-assert-c++.cc +++ b/assert/tst-assert-c++.cc @@ -21,7 +21,6 @@ #undef NDEBUG #include -#if __GNUC_PREREQ (5, 0) /* The C++ standard requires that if the assert argument is a constant subexpression, then the assert itself is one, too. */ constexpr int @@ -78,14 +77,5 @@ do_test () return 0; } -#else -#include - -static int -do_test () -{ - return EXIT_UNSUPPORTED; -} -#endif #include diff --git a/elf/tst-stringtable.c b/elf/tst-stringtable.c index 5fffb0de1b..baeca020bb 100644 --- a/elf/tst-stringtable.c +++ b/elf/tst-stringtable.c @@ -17,7 +17,6 @@ #include #include -#if __GNUC_PREREQ (5, 0) #include #include #include @@ -180,12 +179,3 @@ do_test (void) #define _(arg) arg #include "stringtable.c" #include "stringtable_free.c" -#else -#include - -int -main (void) -{ - return EXIT_UNSUPPORTED; -} -#endif diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c index ccfae789b3..a20e91ee27 100644 --- a/io/tst-utimensat-skeleton.c +++ b/io/tst-utimensat-skeleton.c @@ -73,7 +73,6 @@ do_test (void) for (int i = 0; i < array_length (tests); i++) { /* Check if we run on port with 32 bit time_t size. */ -#if __GNUC_PREREQ (5, 0) time_t t; if (__builtin_add_overflow (tests[i].v1, 0, &t) || __builtin_add_overflow (tests[i].v2, 0, &t)) @@ -82,9 +81,6 @@ do_test (void) "time_t overflows\n", i, tests[i].v1, tests[i].v2); continue; } -#else - return EXIT_UNSUPPORTED; -#endif if (tests[i].v1 >= 0x100000000LL && !y2106) { diff --git a/misc/tst-fd_to_filename.c b/misc/tst-fd_to_filename.c index bc7cf9826b..0e89ba4d4a 100644 --- a/misc/tst-fd_to_filename.c +++ b/misc/tst-fd_to_filename.c @@ -17,7 +17,6 @@ . */ #include -#if __GNUC_PREREQ (5, 0) #include #include #include @@ -100,12 +99,3 @@ do_test (void) } #include -#else -#include - -int -main (void) -{ - return EXIT_UNSUPPORTED; -} -#endif diff --git a/signal/tst-minsigstksz-1.c b/signal/tst-minsigstksz-1.c index 1b9778516d..44634d36a2 100644 --- a/signal/tst-minsigstksz-1.c +++ b/signal/tst-minsigstksz-1.c @@ -38,7 +38,7 @@ /* We do not try to test atomic operations exhaustively, only a simple atomic counter increment. This is only safe if atomic_[u]int is unconditionally lock-free. */ -#if defined __STDC_NO_ATOMICS__ || !__GNUC_PREREQ (5, 0) +#if defined __STDC_NO_ATOMICS__ # define TEST_ATOMIC_OPS 0 #else # include diff --git a/string/tester.c b/string/tester.c index 33a77d5eb2..462de22478 100644 --- a/string/tester.c +++ b/string/tester.c @@ -64,9 +64,7 @@ static __typeof (memset) * volatile memset_indirect = memset; are larger than the actual buffers, which result in various warnings. */ DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds"); -#if __GNUC_PREREQ (5, 0) DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args"); -#endif #if __GNUC_PREREQ (7, 0) DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict"); DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow="); diff --git a/sysdeps/unix/sysv/linux/tst-getdents64.c b/sysdeps/unix/sysv/linux/tst-getdents64.c index cdbd9c9c3f..e8e23d8eeb 100644 --- a/sysdeps/unix/sysv/linux/tst-getdents64.c +++ b/sysdeps/unix/sysv/linux/tst-getdents64.c @@ -30,7 +30,6 @@ #include #include -#if __GNUC_PREREQ (5, 0) /* Called by large_buffer_checks below. */ static void large_buffer_check (int fd, char *large_buffer, size_t large_buffer_size) @@ -86,12 +85,6 @@ do_test_large_size (void) xclose (fd); } -#else -static void -do_test_large_size (void) -{ -} -#endif static void do_test_by_size (size_t buffer_size) diff --git a/sysdeps/x86/tst-cpu-features-supports.c b/sysdeps/x86/tst-cpu-features-supports.c index 88b6a6daae..4b5cd2d12e 100644 --- a/sysdeps/x86/tst-cpu-features-supports.c +++ b/sysdeps/x86/tst-cpu-features-supports.c @@ -97,19 +97,15 @@ do_test (int argc, char **argv) # endif fails += CHECK_FEATURE_ACTIVE (avx512dq, AVX512DQ); #endif -#if __GNUC_PREREQ (5, 0) fails += CHECK_FEATURE_ACTIVE (avx512f, AVX512F); -#endif #if __GNUC_PREREQ (6, 0) # if !__GNUC_PREREQ (15, 0) fails += CHECK_FEATURE_ACTIVE (avx512pf, AVX512PF); # endif fails += CHECK_FEATURE_ACTIVE (avx512vl, AVX512VL); #endif -#if __GNUC_PREREQ (5, 0) fails += CHECK_FEATURE_ACTIVE (bmi, BMI1); fails += CHECK_FEATURE_ACTIVE (bmi2, BMI2); -#endif #if __GNUC_PREREQ (11, 0) fails += CHECK_FEATURE_ACTIVE (cldemote, CLDEMOTE); fails += CHECK_FEATURE_ACTIVE (clflushopt, CLFLUSHOPT); @@ -122,10 +118,8 @@ do_test (int argc, char **argv) fails += CHECK_FEATURE_PRESENT (enqcmd, ENQCMD); fails += CHECK_FEATURE_ACTIVE (f16c, F16C); #endif -#if __GNUC_PREREQ (4, 9) fails += CHECK_FEATURE_ACTIVE (fma, FMA); fails += CHECK_FEATURE_ACTIVE (fma4, FMA4); -#endif #if __GNUC_PREREQ (11, 0) fails += CHECK_FEATURE_PRESENT (fsgsbase, FSGSBASE); fails += CHECK_FEATURE_ACTIVE (fxsave, FXSR); @@ -169,9 +163,7 @@ do_test (int argc, char **argv) fails += CHECK_FEATURE_ACTIVE (sse3, SSE3); fails += CHECK_FEATURE_ACTIVE (sse4.1, SSE4_1); fails += CHECK_FEATURE_ACTIVE (sse4.2, SSE4_2); -#if __GNUC_PREREQ (4, 9) fails += CHECK_FEATURE_ACTIVE (sse4a, SSE4A); -#endif fails += CHECK_FEATURE_ACTIVE (ssse3, SSSE3); #if __GNUC_PREREQ (11, 0) fails += CHECK_FEATURE_ACTIVE (tbm, TBM); @@ -185,9 +177,7 @@ do_test (int argc, char **argv) fails += CHECK_FEATURE_ACTIVE (waitpkg, WAITPKG); fails += CHECK_FEATURE_ACTIVE (wbnoinvd, WBNOINVD); #endif -#if __GNUC_PREREQ (4, 9) fails += CHECK_FEATURE_ACTIVE (xop, XOP); -#endif #if __GNUC_PREREQ (11, 0) fails += CHECK_FEATURE_ACTIVE (xsave, XSAVE); fails += CHECK_FEATURE_ACTIVE (xsavec, XSAVEC); diff --git a/time/tst-ctime.c b/time/tst-ctime.c index 05c3805504..55dc941d3c 100644 --- a/time/tst-ctime.c +++ b/time/tst-ctime.c @@ -20,7 +20,6 @@ #include #include -#if __GNUC_PREREQ (5, 0) static int do_test (void) { @@ -71,12 +70,3 @@ do_test (void) } #include -#else -#include - -int -main (void) -{ - return EXIT_UNSUPPORTED; -} -#endif diff --git a/time/tst-difftime.c b/time/tst-difftime.c index 378eaab1f6..6fe679bf18 100644 --- a/time/tst-difftime.c +++ b/time/tst-difftime.c @@ -19,7 +19,6 @@ #include #include -#if __GNUC_PREREQ (5, 0) static void test_difftime_helper (time_t t1, time_t t0, double exp_val) { @@ -55,12 +54,3 @@ do_test (void) } #include -#else -#include - -int -main (void) -{ - return EXIT_UNSUPPORTED; -} -#endif diff --git a/time/tst-mktime4.c b/time/tst-mktime4.c index 08b1da324b..9f869c1a9d 100644 --- a/time/tst-mktime4.c +++ b/time/tst-mktime4.c @@ -20,7 +20,6 @@ #include #include -#if __GNUC_PREREQ (5, 0) const struct tm tm0 = { .tm_year = 70, @@ -108,12 +107,3 @@ do_test (void) } #include -#else -#include - -int -main (void) -{ - return EXIT_UNSUPPORTED; -} -#endif From patchwork Sun Nov 9 21:53:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123861 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64AEF3858412 for ; Sun, 9 Nov 2025 22:16:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64AEF3858412 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=TsdFH5pd X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id E05443858422 for ; Sun, 9 Nov 2025 21:53:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E05443858422 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E05443858422 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725226; cv=none; b=JTqBjfqKIqEUjABkcIEbl12bIb6CWoqhgGGKTr9FzxHHPmh2DQqh1bF2PaCLh++Ys/Y85uxrrBMmbkujJY6w+w69sGh8P85/yOgpYLduPIYYB/x9pUYJAVYwNDdhW7LOFb2f94vI1W1RHurRvyHEBqItb3N7KJF795FGn48kUMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725226; c=relaxed/simple; bh=06nd6RF4liIwfI6lQxqHwbf4ESFnkcY1LjkocuEkXlI=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=OdJ8gLluNCmaIAQs03oPZi3NkEUNe2fIxAvWklnthqkFB+V5vJm2GevYWXRaB++QhOooQw+m+JXsw+U7o+bwIUryYVQtGQ8Ttd7YeV0KWAZWxCUWxN3AU/OA+dt8juUBg0UqxYMZNQMYPd/XGA2nqXUhl80SvPZgvm1MkY84POo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E05443858422 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 45F754369A for ; Sun, 9 Nov 2025 21:53:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D04AC116B1; Sun, 9 Nov 2025 21:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725225; bh=06nd6RF4liIwfI6lQxqHwbf4ESFnkcY1LjkocuEkXlI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TsdFH5pda1fnXajYo4CeGaU30HNUIDlxnx0viNtuSW67wzQOWUXozvtFV2bEZVKPC QSopSdY+fIUrBioSvTdtRh2jZvYCxTqcvTGUELxG1iV17DB/UScD+P4vcY47m1dJVM sZU4IX7J0f8hovsObScW6hjXwY1Tfj9Yq+jKLNURl/Q4qBesriHtfQtd0jCTCT8eOm zoWJnHveE8Aqry5MK3b9ZEtbq7P1EWgw2SvDD8vHI84oBHevrke7affIfU0FNlUl1b gXUggj+NjH+NzoCt0kq1PZfzRXkcPxN+9q2AYanzfIWhrct4G/4mEPysbRwZ+SVfAD ztH5TpAEPG9wA== Date: Sun, 9 Nov 2025 22:53:42 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 22/35] soft-fp/: Remove _FP_UNREACHABLE macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as __builtin_unreachable(). Signed-off-by: Alejandro Colomar --- soft-fp/op-common.h | 8 ++++---- soft-fp/soft-fp.h | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index 6400926b61..f8e6ded958 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -925,7 +925,7 @@ break; \ \ default: \ - _FP_UNREACHABLE; \ + __builtin_unreachable (); \ } \ } \ while (0) @@ -1092,7 +1092,7 @@ break; \ \ default: \ - _FP_UNREACHABLE; \ + __builtin_unreachable (); \ } \ \ /* T = X * Y is zero, infinity or NaN. */ \ @@ -1148,7 +1148,7 @@ break; \ \ default: \ - _FP_UNREACHABLE; \ + __builtin_unreachable (); \ } \ done_fma: ; \ } \ @@ -1216,7 +1216,7 @@ break; \ \ default: \ - _FP_UNREACHABLE; \ + __builtin_unreachable (); \ } \ } \ while (0) diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index a949962a63..086fb34a28 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -47,10 +47,6 @@ # endif #endif -/* For unreachable default cases in switch statements over bitwise OR - of FP_CLS_* values. */ -# define _FP_UNREACHABLE __builtin_unreachable () - #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define _FP_STATIC_ASSERT(expr, msg) \ From patchwork Sun Nov 9 21:53:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123867 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52BC93858405 for ; Sun, 9 Nov 2025 22:20:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52BC93858405 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=M4sbp5iF X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 7D4C43858424 for ; Sun, 9 Nov 2025 21:53:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D4C43858424 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7D4C43858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725228; cv=none; b=F7jQ9DVeThYlHELhmmvlM4EqebjZTY2O3VkpLztuz/+FK5u6mIzwrXQnelhTF0uYo2nb8TgR74qYNNIsCyxfD0hUz3jyfpEmuLZClgF2JDDUyMJGXXZK2n1UEcoMPZ9tW/1McCqJwZheUCHMQotFTgpgfjLidyRKStxQTUQeAsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725228; c=relaxed/simple; bh=lxzdQwvEzfhwoxJSGuCmGDKxvK65qXoVK25YYvwpcLs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=LD7MXFDEZk66jpqIOfDVOQzz1dkl+Q7dEoXT0X5Wz2CfLu2+FfB0+oo5Blb8C0Um8CbaAmhkS/9AYSvHKz/boSw3eQrK9BTY9KKMi2HMXn2bzn8C2CftNuDHM888unUH1mQSj+/X+sz6lQBhRFjhEn+WFtZwAI1JMRsRB3qq2rs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D4C43858424 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id E8EC643711 for ; Sun, 9 Nov 2025 21:53:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26528C19421; Sun, 9 Nov 2025 21:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725227; bh=lxzdQwvEzfhwoxJSGuCmGDKxvK65qXoVK25YYvwpcLs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M4sbp5iFv95xstl5tAN9zBka+BIlqnVhnPAEz3zs78p+vKeTZ8YIc4NrU0jwYpWNP UZ/IaCnP0hFGHLHeYBZfFAjjU1CYDL392ojkAPsra2RhXMx8HBidFHDR33Fs/nMU0q HKz7IcGVv0cbSv6OBjrigq5Cnel7zgqTAw+ESvdnkwEeB4e4VoKOGvL7GweQUo3ogq BxgoDcSFZulok5ytve5Pl/rVyxaP8FGxGbF5TR4jZibeTLuFoUD5BmX7iOHxR6YqK+ kxYYOTgvcb24pfkpXgdxRvkGw2JgFjWTuBcBcWHkBtZed7FMKwmZ8b671l+OQM/Tiu 2DzXyY/qP0FCA== Date: Sun, 9 Nov 2025 22:53:45 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 23/35] Assume _Static_assert(3) is supported by the compiler Message-ID: <1a0641e3759824a3cb5f195a259cbd18cc9f92d6.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. I don't know when Clang added support for _Static_assert(3), but I see it being supported in Clang 3.3: llvm.git c804e08a674a (2013-04-03; "Enable use of _Static_assert inside structs and unions in C11 mode (as per C11 6.7.2.1p1).") $ git describe --contains c804e08a674a llvmorg-3.3.0-rc1~7^2~2197 Signed-off-by: Alejandro Colomar --- soft-fp/soft-fp.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index 086fb34a28..e13eb8e0c4 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -47,15 +47,8 @@ # endif #endif -#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ - || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define _FP_STATIC_ASSERT(expr, msg) \ _Static_assert ((expr), msg) -#else -# define _FP_STATIC_ASSERT(expr, msg) \ - extern int (*__Static_assert_function (void)) \ - [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] -#endif /* In the Linux kernel, some architectures have a single function that uses different kinds of unpacking and packing depending on the From patchwork Sun Nov 9 21:53:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123854 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5832A3858C36 for ; Sun, 9 Nov 2025 22:09:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5832A3858C36 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qRXyfE/P X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 306E33858425 for ; Sun, 9 Nov 2025 21:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 306E33858425 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 306E33858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725231; cv=none; b=flPTCbHlT1LNnRwt+XJrqTQ0QdtAt8Z5XxBkiskLrgEFF2i2EHI79/MEwqk0FUUSU7Qfez/oSlLz8VptpZDy76ZL+sloRGPGLDeol2yLAbX0jBMarXmbUL2OcaIbnUSC7CrkGV0RIsveiRBZFemowfZoaJfi95V+GYG5FCH8x5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725231; c=relaxed/simple; bh=mvZoWxSk80wJtF1PcXG5UXWEcMs5yoPz6+0583xHbBU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=X9MWmfA7vAAE1rDNcnCewf1EUg38YkTRwIL6K7VuaZ9ngFvIraFYerdeR0mKEiNPs40hldAYhII4w2TJk74CeOnVEUL5xdhuDV/twBj+ugQKYgtiL+EZJQydLtqDgwlgjUncqkxPgl10Qqw6FOl86pPAQglFP4mS73bgmzTa4EQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 306E33858425 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 894AF4369A for ; Sun, 9 Nov 2025 21:53:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD367C4CEF7; Sun, 9 Nov 2025 21:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725230; bh=mvZoWxSk80wJtF1PcXG5UXWEcMs5yoPz6+0583xHbBU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qRXyfE/PrVVdBsgv0j23dpTDm2gODwGBDTQCz8thIhAHyedQ6HaqnzuTh+88D4A4P c9qMx0VotBsNKx2QcciHbr2affR1GzFGrsNJfzrgkDKMBCRM3URdn2eL4FvlCc3XT+ sjT6fM/aXHb4GN0FP7PXeCm1tGb4qAHCwdwEc8jtZI7O9DbIkTLFroWd7fzDEVFnYj gneI5WyPIMZickbnLnkaTalV/M3c6MJgSYuO9mNzV3v7cIAx7gzrGGfc9Gs21AeMaD 0lhpaYye4QpC1fusOS0xPYCci+Pbj/Z5m1HREG++fHc/z44U/l87f7FbWRI/nX636C fhuS+as0UpacQ== Date: Sun, 9 Nov 2025 22:53:48 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 24/35] soft-fp/: Remove _FP_STATIC_ASSERT() macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as _Static_assert(). Signed-off-by: Alejandro Colomar --- soft-fp/op-2.h | 2 +- soft-fp/op-common.h | 16 ++++++++-------- soft-fp/soft-fp.h | 3 --- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h index 17a50ade32..3c45c50233 100644 --- a/soft-fp/op-2.h +++ b/soft-fp/op-2.h @@ -454,7 +454,7 @@ _p240, _q240, _r240, _s240; \ UDItype _t240, _u240, _v240, _w240, _x240, _y240 = 0; \ \ - _FP_STATIC_ASSERT ((wfracbits) >= 106 && (wfracbits) <= 120, \ + _Static_assert ((wfracbits) >= 106 && (wfracbits) <= 120, \ "wfracbits out of range"); \ \ setfetz; \ diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index f8e6ded958..292443fbe5 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -1800,7 +1800,7 @@ if ((X##_s = ((r) < 0))) \ _FP_FROM_INT_ur = -_FP_FROM_INT_ur; \ \ - _FP_STATIC_ASSERT ((rsize) <= 2 * _FP_W_TYPE_SIZE, \ + _Static_assert ((rsize) <= 2 * _FP_W_TYPE_SIZE, \ "rsize too large"); \ (void) (((rsize) <= _FP_W_TYPE_SIZE) \ ? ({ \ @@ -1876,13 +1876,13 @@ #define _FP_EXTEND_CNAN(dfs, sfs, dwc, swc, D, S, check_nan) \ do \ { \ - _FP_STATIC_ASSERT (_FP_FRACBITS_##dfs >= _FP_FRACBITS_##sfs, \ + _Static_assert (_FP_FRACBITS_##dfs >= _FP_FRACBITS_##sfs, \ "destination mantissa narrower than source"); \ - _FP_STATIC_ASSERT ((_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \ + _Static_assert ((_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \ >= _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs), \ "destination max exponent smaller" \ " than source"); \ - _FP_STATIC_ASSERT (((_FP_EXPBIAS_##dfs \ + _Static_assert (((_FP_EXPBIAS_##dfs \ >= (_FP_EXPBIAS_##sfs \ + _FP_FRACBITS_##sfs - 1)) \ || (_FP_EXPBIAS_##dfs == _FP_EXPBIAS_##sfs)), \ @@ -1950,9 +1950,9 @@ #define FP_TRUNC(dfs, sfs, dwc, swc, D, S) \ do \ { \ - _FP_STATIC_ASSERT (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \ + _Static_assert (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \ "destination mantissa wider than source"); \ - _FP_STATIC_ASSERT (((_FP_EXPBIAS_##sfs \ + _Static_assert (((_FP_EXPBIAS_##sfs \ >= (_FP_EXPBIAS_##dfs \ + _FP_FRACBITS_##dfs - 1)) \ || _FP_EXPBIAS_##sfs == _FP_EXPBIAS_##dfs), \ @@ -2042,7 +2042,7 @@ #define FP_TRUNC_COOKED(dfs, sfs, dwc, swc, D, S) \ do \ { \ - _FP_STATIC_ASSERT (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \ + _Static_assert (_FP_FRACBITS_##sfs >= _FP_FRACBITS_##dfs, \ "destination mantissa wider than source"); \ if (S##_c == FP_CLS_NAN) \ _FP_FRAC_SRL_##swc (S, (_FP_WFRACBITS_##sfs \ @@ -2067,7 +2067,7 @@ # define __FP_CLZ(r, x) \ do \ { \ - _FP_STATIC_ASSERT ((sizeof (_FP_W_TYPE) == sizeof (unsigned int) \ + _Static_assert ((sizeof (_FP_W_TYPE) == sizeof (unsigned int) \ || (sizeof (_FP_W_TYPE) \ == sizeof (unsigned long)) \ || (sizeof (_FP_W_TYPE) \ diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index e13eb8e0c4..51d3b437a4 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -47,9 +47,6 @@ # endif #endif -# define _FP_STATIC_ASSERT(expr, msg) \ - _Static_assert ((expr), msg) - /* In the Linux kernel, some architectures have a single function that uses different kinds of unpacking and packing depending on the instruction being emulated, meaning it is not readily visible to From patchwork Sun Nov 9 21:53:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123869 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98A3F3858409 for ; Sun, 9 Nov 2025 22:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98A3F3858409 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=JErrV1pX X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id C655D385840F for ; Sun, 9 Nov 2025 21:53:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C655D385840F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C655D385840F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725233; cv=none; b=JwesyXp0zHTj818ROn4kiRNIm6U7oSEcAyr2URKvHzVJGN3UY5/r5WMj8uMmgWjDK0IZjfX+3KXgB+lIkctX/05mFtau2yI+pWxSvsDhZOtQYKClvFANBWRBm5M3fTxWmOjewgVTDsuHNy7swe7s7FXfqbeELqnefHzqeP7xjAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725233; c=relaxed/simple; bh=v79IADIFUBd91H1nAKF9oEuIf5UwoNtgB078Fw43i2k=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JOFz33rNfi9QJLipwMXYcRcxPNCSLBPoQ0npQkonOJiEs50BTgWqYhGxmZDt/d/96lpxuC77F3sulyxcXOXFjcKzLtC4P6aGlnj03b6aTBOKMuWzCOLSLFri+mNXj44OQky/GN3Hhab1TXj7VS8xMBwSEp+cEl7aNbq0jB7Bfy8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C655D385840F Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 3A77B42B1B for ; Sun, 9 Nov 2025 21:53:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B78AC4CEF7; Sun, 9 Nov 2025 21:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725233; bh=v79IADIFUBd91H1nAKF9oEuIf5UwoNtgB078Fw43i2k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JErrV1pXe0M1wn67DvdOAx83zqtqH+GGzXf9kBELwO5IsURtXbftiKLhiMXKGCAjz H7HaI/nMocPyfu7pqaIyD/LTmi59HdGAJBXGRh6PIHImXcnx2rv/87Uyp+HYR1GWM9 x1TGx+M2tnsHT3y+RCSuPKVZSKs+2PVDIizx6/Dns4hUc3Adx862EX+vYWv/jvqVUP EFsnSuMpjaCFoIgRvO+89AzT5U4uIFrpagg+K4J77YHEnHp4gxA+wbfb/KoIpHdojn PQ/5WEKF+A3WghkEvYWSH/ln/2qYPGszj36Aq82NPxh24uTBdYlelpI6cEeoNeShUl qMrptNelH7rVg== Date: Sun, 9 Nov 2025 22:53:50 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 25/35] Assume support for the 'unused' attribute on labels Message-ID: <8e56f7709ca3fbea7c12a2b4ab9e194b73aa2cdf.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. It seems to me that Clang added support for this attribute in labels in Clang 2.9: llvm.git 9f48354b7127 (2010-09-28; "Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.") $ git describe --contains 9f48354b7127 llvmorg-2.9.0-rc1~9894 Signed-off-by: Alejandro Colomar --- include/libc-symbols.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 1f59b69ecf..d8c77eb741 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -815,15 +815,9 @@ for linking") GCC -Wunused-parameter. */ # define _GL_UNUSED __attribute__ ((__unused__)) -/* gcc supports the "unused" attribute on possibly unused labels, and - g++ has since version 4.5. Note to support C++ as well as C, +/* Note to support C++ as well as C, _GL_UNUSED_LABEL should be used with a trailing ; */ -#if !defined __cplusplus || __GNUC__ > 4 \ - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) # define _GL_UNUSED_LABEL _GL_UNUSED -#else -# define _GL_UNUSED_LABEL -#endif # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) From patchwork Sun Nov 9 21:53:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123870 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3516F385841C for ; Sun, 9 Nov 2025 22:26:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3516F385841C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=hDqz0UnS X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 5DBDA3858413 for ; Sun, 9 Nov 2025 21:53:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DBDA3858413 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5DBDA3858413 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725236; cv=none; b=lk47N1hIC9wAatKB3gezvVyZfOBihaDYNyevZqnjwcYMLzwty+RdtM7uhGAnuRj/X8M1xM1cTTEkH9z/4HrLLCjS9cjKOIX2A+JrEXN5nFCxM9+marJz9+0oFBGXwnUa+rMTCnQSe+OIOj/DkIZkPssV2hAdCKTdAf81yusv3QA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725236; c=relaxed/simple; bh=yOHNexf6gJ565iZGVFavxeCRAdfREFyX0nwFV0pujUg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=YTQEFt7z5ZpdSC6HVu/zTD7Ijj6dANYlpdM0/ZBjPvenHyXDe9fNQDLOlV9/t8Ya0WuFk9LsH3hByMSLF8BGBTIcnobXu12mPrdxaKs0AxyV0jrM0kw3T+qvPIwoVNohoI2RSJNDaRa3AJKmIBBuPyPEZoV97kzjCePNV1TY/eA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DBDA3858413 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 07AEA60008 for ; Sun, 9 Nov 2025 21:53:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BE97C116B1; Sun, 9 Nov 2025 21:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725235; bh=yOHNexf6gJ565iZGVFavxeCRAdfREFyX0nwFV0pujUg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hDqz0UnSBl1OjKH/IYvLqRt3KaHEN3koQE1kJqvJrwP+Lg89+6rGNSYW8/crDkSrk QY6/s11KJiD3gstWqdZYTK2JTojjIF/w8/3S8s+nKE8N1ZJdK8TvHDAo9h35Wypylr C0TaFKL3ipPjKEr0r7cXzdKSvxReBzrWoTY8catyj8mqk9ErGQ2bHUPvKUppwphNWw Lx28E8GtqJQMhpFmtK4BmmAIX144BPDLmrmJ8K281dpnmoF/gfqiJvH6MgxQY6rdwA cDGjhes3xAA3XvhAGuLJrOfE2dbUzK8mcYcEJzaoTJniZVcMuJ7356cLDtnDiNsDNI lTW6yzXyEyflg== Date: Sun, 9 Nov 2025 22:53:53 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 26/35] include/libc-symbols.h: Remove unused _GL_UNUSED_LABEL macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- include/libc-symbols.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index d8c77eb741..4ce0d964bc 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -815,10 +815,6 @@ for linking") GCC -Wunused-parameter. */ # define _GL_UNUSED __attribute__ ((__unused__)) -/* Note to support C++ as well as C, - _GL_UNUSED_LABEL should be used with a trailing ; */ -# define _GL_UNUSED_LABEL _GL_UNUSED - # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) From patchwork Sun Nov 9 21:53:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123853 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F31E93858405 for ; Sun, 9 Nov 2025 22:08:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F31E93858405 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Yy0BclbW X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 1C901385841E for ; Sun, 9 Nov 2025 21:53:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C901385841E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1C901385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725239; cv=none; b=MK46dOahI4TvL6o+bZC0pkdEgv4ABubxXVlTCF9R/EdkbXrAOEIqnoIs9PfSs5R3GV2/2naaTCpznXQczxqb+Fz6gTip/IIIPxX/Q8Tdvoh2eO9ECrpxRQdovv9smIgL0oop9W3hCAu91RTjGX1hjkYMArxnYRaBuOBKvN6YzVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725239; c=relaxed/simple; bh=i6v3z0AM+W8El07hlxak5nHpluaTi+FngBE9EILlNwA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=prw74VWP5zWGoIit63EM22/dgoMOvmDk5oK06cq7d++3fcjN/vtUcoZyfimDieGoK4lYxgzmKKdwyZ9H59Uqjv50PXgBZ4JRNcNBfghglOa2MH0l66JlcjTqNZ8tyJDFSVDJ9ztkLsjBnMt3wxafDJnwYp5wrm+12YQgqmf9g/0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C901385841E Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 86784438F3 for ; Sun, 9 Nov 2025 21:53:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B739BC4CEFB; Sun, 9 Nov 2025 21:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725238; bh=i6v3z0AM+W8El07hlxak5nHpluaTi+FngBE9EILlNwA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yy0BclbWLU4Aw63g3vw4c758KRNPhLiJW4JlvTJR9VQGyZBQkx0W1yIFVNwVrfO6x OlLX160hY1N3j9Tqr46auZcBDzHZeOfpQssigV04hZqSac8ljcriwgnrbaLzKvALKi OHqR+tzw27h3FQuHA70o6YjGM14prSo7Ok6Fq16Eu+SEViVO4QSDaBZO0IV4O9Ltg6 ZRTCCTdPICqaJ4nukrAHcpkDBAIv1GBsNJgovaYsVQC7mahHsZlHnOlegXrvyE9LSv HgaDi9sp2In1eljd+e92pcCpWRRoRtOXr4qErg6aCe9q5Aur5l570ydw+ukefUplZv AypR25KI8/KyQ== Date: Sun, 9 Nov 2025 22:53:55 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 27/35] Assume __has_builtin(__builtin_bswap{16,32,64}) Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for __builtin_bswap{32,64}() in Clang 2.2: llvm.git ef93b9d01107 (2007-12-02; "Implement __builtin_bswap32 and __builtin_bswap64.") $ git describe --contains ef93b9d01107 llvmorg-2.2.0~1426 Also, Clang added support for __builtin_bswap16() in Clang 3.2: llvm.git a801f4a81dc2 (2012-10-06; "Expose __builtin_bswap16.") $ git describe --contains a801f4a81dc2 llvmorg-3.2.0-rc1~1^2~2032 Signed-off-by: Alejandro Colomar --- bits/byteswap.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bits/byteswap.h b/bits/byteswap.h index c0841a3574..e2bddb7f06 100644 --- a/bits/byteswap.h +++ b/bits/byteswap.h @@ -33,11 +33,7 @@ static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { -#if __GNUC_PREREQ (4, 8) return __builtin_bswap16 (__bsx); -#else - return __bswap_constant_16 (__bsx); -#endif } /* Swap bytes in 32-bit value. */ @@ -48,11 +44,7 @@ __bswap_16 (__uint16_t __bsx) static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { -#if __GNUC_PREREQ (4, 3) return __builtin_bswap32 (__bsx); -#else - return __bswap_constant_32 (__bsx); -#endif } /* Swap bytes in 64-bit value. */ @@ -69,11 +61,7 @@ __bswap_32 (__uint32_t __bsx) __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { -#if __GNUC_PREREQ (4, 3) return __builtin_bswap64 (__bsx); -#else - return __bswap_constant_64 (__bsx); -#endif } #endif /* _BITS_BYTESWAP_H */ From patchwork Sun Nov 9 21:53:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123862 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE2073858402 for ; Sun, 9 Nov 2025 22:16:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE2073858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SYpWw9T2 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id C51993858417 for ; Sun, 9 Nov 2025 21:54:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C51993858417 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C51993858417 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725241; cv=none; b=Y7TqTB8g66UlznLxBtSZkX2/DSu0FUjnn0fhPEAeB2yKTNQxCnfV3B0xSsWE+wv4YjFxg/Zo6O5/XrwGed5P7Z5hhr27BGqHEH+N4pdYd84BaPdreovJyI2SWx+bL9KIuBTFyHShz8Yfp0BJFdykvC1Ueuo6amo2ZT4D6apIaSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725241; c=relaxed/simple; bh=Phm6/MMw0K73vawnbcoAqpMQYPFwSYGj+VfLa8JIHJY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vx5eL9vG46QUGFCHn6keZiSewoYBCbLxeIhPKkuiS+2g/Um0AtCBEcrS4qovlr3jYrLdmH+LIjm4t63zEkhxFhojRzajMmuHN5fQc4Wa/ty1Ty/JCgIDzAljWC6DVyZdU7uaoHMltvnt/ZMpUWv4JYmWJ1m0v1MZX+TCKz9ubp8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C51993858417 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 236FF4369A for ; Sun, 9 Nov 2025 21:54:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 593A1C4CEF8; Sun, 9 Nov 2025 21:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725241; bh=Phm6/MMw0K73vawnbcoAqpMQYPFwSYGj+VfLa8JIHJY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SYpWw9T2SqTOygq1D6DxhWPWqExI/kZ1b4oNFhSMD4HdAOHKUJU/3a9mqvQe2+WM6 Evp9h8JfUVnRJFKzioYeFKSfjlR0X9puU7DVNaKWY7jo4HOp+FfNMbhYOgWhGwDbof 4Q2ZF3NUEHWi4fXswayJAiVyF0fCH1mXBwcRn1uSUm5Xci6P28YrR7fqw8W15Gm7+Y fGAI7wfh4jQxK8BPNmx1cFUYkwkDnY5aoFKp3vbgp16H/kPwvoyAcLFzulJ1KISzzn vVDE5cgikgnVitFRU30/g9E9RmQSRhei1vKkxLEOoYrslQ3BCCrnumHqMYhbxwU8sR xXyyCQwne8Iqw== Date: Sun, 9 Nov 2025 22:53:58 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 28/35] nss/: Use __builtin_bswap32() instead of __bswap_constant_32() Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org See the previous commit. We assume it's supported by the compiler. Signed-off-by: Alejandro Colomar --- nss/getaddrinfo.c | 2 +- nss/tst-rfc3484-2.c | 2 +- nss/tst-rfc3484-3.c | 2 +- nss/tst-rfc3484.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c index 6726ace6fd..b2fcbc51f1 100644 --- a/nss/getaddrinfo.c +++ b/nss/getaddrinfo.c @@ -1237,7 +1237,7 @@ struct sort_result_combo #if __BYTE_ORDER == __BIG_ENDIAN # define htonl_c(n) n #else -# define htonl_c(n) __bswap_constant_32 (n) +# define htonl_c(n) __builtin_bswap32 (n) #endif static const struct scopeentry diff --git a/nss/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c index a5f8f82c04..f8e612b0bd 100644 --- a/nss/tst-rfc3484-2.c +++ b/nss/tst-rfc3484-2.c @@ -68,7 +68,7 @@ nss_action_list __nss_hosts_database attribute_hidden; #if __BYTE_ORDER == __BIG_ENDIAN # define h(n) n #else -# define h(n) __bswap_constant_32 (n) +# define h(n) __builtin_bswap32 (n) #endif diff --git a/nss/tst-rfc3484-3.c b/nss/tst-rfc3484-3.c index edf0b7db2e..684eda71d6 100644 --- a/nss/tst-rfc3484-3.c +++ b/nss/tst-rfc3484-3.c @@ -68,7 +68,7 @@ nss_action_list __nss_hosts_database attribute_hidden; #if __BYTE_ORDER == __BIG_ENDIAN # define h(n) n #else -# define h(n) __bswap_constant_32 (n) +# define h(n) __builtin_bswap32 (n) #endif struct sockaddr_in addrs[] = diff --git a/nss/tst-rfc3484.c b/nss/tst-rfc3484.c index 5b4a0c5b82..19e0639609 100644 --- a/nss/tst-rfc3484.c +++ b/nss/tst-rfc3484.c @@ -68,7 +68,7 @@ nss_action_list __nss_hosts_database attribute_hidden; #if __BYTE_ORDER == __BIG_ENDIAN # define h(n) n #else -# define h(n) __bswap_constant_32 (n) +# define h(n) __builtin_bswap32 (n) #endif struct sockaddr_in addrs[] = From patchwork Sun Nov 9 21:54:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123859 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC4D13858408 for ; Sun, 9 Nov 2025 22:13:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC4D13858408 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=llgRFqT+ X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 6591F385842B for ; Sun, 9 Nov 2025 21:54:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6591F385842B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6591F385842B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725244; cv=none; b=lGxKuKozWBSWcQK1cZPbCIfM81wA6MUox/Jf4ODDbNjPlXd0mwc1b1VpqbSbneT8BVPAoJ8S56vnN/G5fCqphv4vTH/rzD1NP8kPJh0/j83RhsPYOdZUVwg96VFeURbpIm1jTKUxIKdEb7ve37KvDqM1ts7DY+T0K77JrFYLlV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725244; c=relaxed/simple; bh=VjdSZ9VhNQ5p2iXDLqguBXBq7ErImhqwq84a97nJDYw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=AxTqAtKDOJ40FxlKH6h3lEGUJtR9V8RkWbAFUKal8h/ZdmnahZ+3dbv4HkfYxyS/TmMV1vFyqMGiAQZhLh8trMfL4wA+N3KcHT8O8Yg5SXPL2sQU1SseglAZVdoJ99gaTfFSxuXEDTN0pCjYQeJ3t6PgtO1ZnJLhGBOCjfNivl4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6591F385842B Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id BECCC42D7C for ; Sun, 9 Nov 2025 21:54:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0785C4CEFB; Sun, 9 Nov 2025 21:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725243; bh=VjdSZ9VhNQ5p2iXDLqguBXBq7ErImhqwq84a97nJDYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=llgRFqT+TEuK15HaUleXsm02t6inDq9oAQDPTsYV5Lijoa6B4Z2fkaT56+jf/cK6u 9bHilfJ91LdjPWIrZ2tETmFRh/DBAqe41gsCpLEuiNBUlVemNBYKqwwIBIaFtjvxwf x/p0FWIFYM21BWRczuURAKo9K8vD3q9+l3TaTP2vZWvBh3YYk2Xtox0+ZFpIJsknYC Z3ZRCHTJtZkwAkbtbPLV4YwNSz5REZ8pCsC1gEGH1nb/HsnsRDwgTitDSgPhwg1VVY ArmYJMcHAS/1xQtLescmajn+IZftCSUbPeixtjzVQgHJdb4uRbmefmODovlAc5ZeNJ yOgNFAjQ9ji6A== Date: Sun, 9 Nov 2025 22:54:01 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 29/35] bits/byteswap.h: Remove unused __bswap_constant_{16,32,64}() macros Message-ID: <2390009c2d5fb70247d6c5cd7d49599e6f9a9e95.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Signed-off-by: Alejandro Colomar --- bits/byteswap.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/bits/byteswap.h b/bits/byteswap.h index e2bddb7f06..d10da1d017 100644 --- a/bits/byteswap.h +++ b/bits/byteswap.h @@ -26,38 +26,18 @@ #include #include -/* Swap bytes in 16-bit value. */ -#define __bswap_constant_16(x) \ - ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) - static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { return __builtin_bswap16 (__bsx); } -/* Swap bytes in 32-bit value. */ -#define __bswap_constant_32(x) \ - ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ - | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) - static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { return __builtin_bswap32 (__bsx); } -/* Swap bytes in 64-bit value. */ -#define __bswap_constant_64(x) \ - ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56)) - __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { From patchwork Sun Nov 9 21:54:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123865 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 661753858434 for ; Sun, 9 Nov 2025 22:19:40 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id D79813858D33 for ; Sun, 9 Nov 2025 21:54:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D79813858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D79813858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725246; cv=none; b=ldrkiY8OeBccE88+UNKuG+URrhOBwoIWzgyv2sGILtL/yp5cKmV2OrsOL/CWUcPu09Z2BOevZlGXzM3IgWUc+BQtSToXcJTnFfNnOFmjECieSg+g1B5b8yxe7ipIZX0ZKtP8t9fXsfOVH28e+topJUQJ++eT9kb8dMZ7l2Vtofo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725246; c=relaxed/simple; bh=MEZn/cyZxlbWkeCGMmvpDcTnXpiJfLhYr369gFPtAWk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=uk3Eo9t4iCxRrWsya1YtIOWP5l8xL++qLkqw6FWT9UQIdNtbLoNk7n6jlLaGWM+usp8LHP8V3Lf98tdls9yaFGqDGdGBIHCg6w+raUHUIEkETNydCPA57UHKoZFXJlgB8f0uOphOrCYmWWFqP5FwfXxp6NSJSNWrIsjNxAcjOzU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D79813858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=dSKDbAim Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 814E160007 for ; Sun, 9 Nov 2025 21:54:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8740BC4CEF7; Sun, 9 Nov 2025 21:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725246; bh=MEZn/cyZxlbWkeCGMmvpDcTnXpiJfLhYr369gFPtAWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dSKDbAimdbld40twPudkZaxdKS4p8ZcpMCKAOWGjyJDCxR9MdksTJEPtL6zy41HIz Q+uny96tkKgjoEWxH0Mb8FbWlDefFdiBO/9TUomCFgzboPagbv545cdL1BHYs59h8Q h9nhCLImHrPyg9Ht03WZU6D1SC4Ii9pVJgmJbRijeChY2DWl6qxY4ikiawAUkM5wzr D07fMZnhIRQ7TvVYeEblqr7xeMvVGlbZLpdhCt1iBu59vLzb5G3nfFyW96aC1B1GR2 ffYZaF7jTcTZyu6NaHPRLbfs9Hqt8bCMpZKMkWFmeJw1zYHa0ZWKpiFKBGtwcLV/WI aMDEuFnwIQAdg== Date: Sun, 9 Nov 2025 22:54:03 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 30/35] Assume __has_builtin(__builtin_ppc_get_timebase) Message-ID: <65251967885c549285e659f6335654693d508aad.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for __builtin_ppc_get_timebase() in Clang 3.8: llvm.git 65e1e4dbe0f1 (2015-08-31; "[PowerPC] Support __builtin_ppc_get_timebase") $ git describe --contains 65e1e4dbe0f1 llvmorg-3.8.0-rc1~10647 Signed-off-by: Alejandro Colomar --- sysdeps/powerpc/sys/platform/ppc.h | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/sysdeps/powerpc/sys/platform/ppc.h b/sysdeps/powerpc/sys/platform/ppc.h index b0e7b0abfb..0b9f370db3 100644 --- a/sysdeps/powerpc/sys/platform/ppc.h +++ b/sysdeps/powerpc/sys/platform/ppc.h @@ -27,27 +27,7 @@ static __inline__ uint64_t __ppc_get_timebase (void) { -#if __GNUC_PREREQ (4, 8) return __builtin_ppc_get_timebase (); -#else -# ifdef __powerpc64__ - uint64_t __tb; - /* "volatile" is necessary here, because the user expects this assembly - isn't moved after an optimization. */ - __asm__ volatile ("mfspr %0, 268" : "=r" (__tb)); - return __tb; -# else /* not __powerpc64__ */ - uint32_t __tbu, __tbl, __tmp; \ - __asm__ volatile ("0:\n\t" - "mftbu %0\n\t" - "mftbl %1\n\t" - "mftbu %2\n\t" - "cmpw %0, %2\n\t" - "bne- 0b" - : "=r" (__tbu), "=r" (__tbl), "=r" (__tmp)); - return (((uint64_t) __tbu << 32) | __tbl); -# endif /* not __powerpc64__ */ -#endif } /* The following functions provide hints about the usage of shared processor From patchwork Sun Nov 9 21:54:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123858 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B89093858405 for ; Sun, 9 Nov 2025 22:12:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B89093858405 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=RVRjl4vv X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 930C2385842F for ; Sun, 9 Nov 2025 21:54:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 930C2385842F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 930C2385842F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725249; cv=none; b=UsA4SPdVQEo/qh5KmkYA4eYiUyvLNA0vgNNf7nZqGF91CkH7+d5DLIxkf8XOZlocWZDUh42NESK7U5zqr2S8iQCiyKJgbd0yXeIq0vSLrvlKD4RHBJhKl6XJasT0LQnbV+l3L08RnniYTqNKDNtgegiqp4HE9JWMt6+baAqrBdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725249; c=relaxed/simple; bh=QyYTXyLEd5hVRRhgftuXMxta5Gb+g/nYHOAswWE+3Jw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=j/XFTW+aSxtAI3U95mQ8JSR4jkHQaZC2YNWP2zbuolKCjyfgG4MQ0aiFS4Y5VFov1msDG1K5DOCpn9r2WieQIZXtG756q9HCLNYWFxdwdFnNYs8UURgjtSu/xoCtQyjXVmLmzEpvRH3PlTrGrFJULoMmKqFMOkL4JRaq7rmOhN0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 930C2385842F Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id EC07342D7C for ; Sun, 9 Nov 2025 21:54:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B3D0C19424; Sun, 9 Nov 2025 21:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725248; bh=QyYTXyLEd5hVRRhgftuXMxta5Gb+g/nYHOAswWE+3Jw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RVRjl4vvxGU3slc5w/GYjDqNm9XzL2zAD0TH48i4Y8SUCEy+wSTctQNyevrErZMT6 vWSwZNmjhSZKfrFaZOorEKgZ/lU7i5ZAjwETyqbqIob/9aeyUM0sEabvHK6PLJdtEO EKiOdisdeZmWqOcRcNgHWSl5nOzfbNbN2Bbl18QrnEintxQQKUKb6kuybqSqr062yd 9tyHktNvJwoRYfGM4RaBYhw0f6pII1V1hU7vw8qyB0D/8SV++uk4SGJNjXVcVf0ZHf jCTKWrlPFHN5Ptu5nwvSXK1J6KScXMLmJ3yh9Xw5D4MWWbljQ6MqHvNKSFFrW7CfV7 QCENguelwQZ1Q== Date: Sun, 9 Nov 2025 22:54:06 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 31/35] Don't use plain inline/__inline for meaning GNU inline Message-ID: <0828a359fdaa1045028d6aa52203e85e3d2e4690.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Use the GCC '__gnu_inline__' attribute explicitly. It makes the code more readable. Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 5 ----- sysdeps/htl/pthread.h | 5 ----- 2 files changed, 10 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 8f565acda1..2320f7293a 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -491,14 +491,9 @@ #if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ || defined __GNUC_GNU_INLINE__))) -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) -# else -# define __extern_inline extern __inline -# define __extern_always_inline extern __always_inline -# endif #endif #ifdef __extern_always_inline diff --git a/sysdeps/htl/pthread.h b/sysdeps/htl/pthread.h index a299fec278..dcb78a2701 100644 --- a/sysdeps/htl/pthread.h +++ b/sysdeps/htl/pthread.h @@ -30,7 +30,6 @@ /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. */ # if !defined __cplusplus || __GNUC_PREREQ (4,3) -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus # define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) # if __GNUC_PREREQ (4,3) # define __extern_always_inline \ @@ -39,10 +38,6 @@ # define __extern_always_inline \ extern __always_inline __attribute__ ((__gnu_inline__)) # endif -# else -# define __extern_inline extern __inline -# define __extern_always_inline extern __always_inline -# endif # endif #endif From patchwork Sun Nov 9 21:54:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123868 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF4A43858427 for ; Sun, 9 Nov 2025 22:21:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF4A43858427 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pRDHvDSB X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 271F43858415 for ; Sun, 9 Nov 2025 21:54:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 271F43858415 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 271F43858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725252; cv=none; b=sNjjVHEaIGBjLR5XTcfPB7KgUzwI4PBSR0bvAla6rQjyiUO0Z24L4wmBtpJK61P0UZRUridXZM5eDWcLZxiycNnJPQ36+2bd6LA1uhO+kpIxD61EdWz+N4qJkzy7iNgFQGLQQGCoZOo74aPI07ICCL/1LMSqH5O8pRURxScVRdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725252; c=relaxed/simple; bh=+TY35wyJfXpOZ2Qq6tj5+xXhFRAUqDnZ9U+UmDU3+A8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=tcxKT/YC4FGJE7uaboNT6A/NtYAzcKzno5Gc4XLUpF/47ugQcwmTaCz7UIal/en2erBZeMC7+qpw8Qdfgm9O4QBLbghTQLzmWYjz9h19w4FRno5yOmKF3MtborTNsd12HxG0loUYo1uWzQRlrg8rUy/7zEWv2uG1COBV2jUibWI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 271F43858415 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id C50D160052 for ; Sun, 9 Nov 2025 21:54:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C44C4C4CEFB; Sun, 9 Nov 2025 21:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725251; bh=+TY35wyJfXpOZ2Qq6tj5+xXhFRAUqDnZ9U+UmDU3+A8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pRDHvDSB91BdpTJZX8YKOWFaY8G2jWJHLNhMkSTc4eBETbsiAkOCdwptcbKbY3mMm ar2j1lZ3/iuK+L2TTyYeUpaanzdsmtyWRRAaYLcWRePReC86N1/WE2wUsVrArrTLHK 3wHVcIrlJIp7VbNLyhQ81rkHXHOVw3jJIWR0J0Rq6S+ZijeYZGG3sXCQS6D7YwyeVv Bb2ZVC2jc7uAlO/5as4z+WWUaV3EVFQBoXNtHIIs1WrM868B7jYsAfrxNAfW19tJuj 2dFRI50lCnl2oAT0P/XQ2a36G62EkTh0FOlt+MuHccBLelzd0oIMqNPSWBXmQqY+OX twVHPMiF0rTcw== Date: Sun, 9 Nov 2025 22:54:09 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 32/35] sysdeps/htl/pthread.h: Remove dead code Message-ID: <71077ff0aa9cbe39449355527885b555bda040d1.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org already defines these macros, so these conditionals never define anything, AFAICS. Signed-off-by: Alejandro Colomar --- sysdeps/htl/pthread.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/sysdeps/htl/pthread.h b/sysdeps/htl/pthread.h index dcb78a2701..f79f329971 100644 --- a/sysdeps/htl/pthread.h +++ b/sysdeps/htl/pthread.h @@ -26,20 +26,6 @@ #include #include -#ifndef __extern_inline -/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 - inline semantics, unless -fgnu89-inline is used. */ -# if !defined __cplusplus || __GNUC_PREREQ (4,3) -# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) -# if __GNUC_PREREQ (4,3) -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) -# else -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__)) -# endif -# endif -#endif #include #include From patchwork Sun Nov 9 21:54:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123863 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 701183858402 for ; Sun, 9 Nov 2025 22:17:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 701183858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=S5Af77MH X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id CBBC93858416 for ; Sun, 9 Nov 2025 21:54:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBBC93858416 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CBBC93858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725254; cv=none; b=gt7EnEQSICXZxf8COD0o0IFrvIkygO2AaChr9g5OXAJ9t2sGo35o1QgfkzQKStGfFywynzM8yhL9RWCWrTS6g3g8veCK+qYe8a2sWw8LUcaDNB6/qvW9P1AVGqLrNIeFGZ6xOivY/+4JiP9StK4K/3eMnPTrJi1eWqVY6xVJOSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725254; c=relaxed/simple; bh=TsxDYPwIadhO886qsSwFp/FcJCAoDTN1wauKLxRQawc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Ez7H6XP0wxw8MoingNEPpPeYYfMNWTb+OAr5Yexk9PwZ2IYHqUS3P/kR8r/6U14F9XDYUUCrHBtGQym6kJRD2FlkWvHB+oSjOCn2lYxNaQRNPLZamMwY/aE+U0z9cOEc/w9Ed3lkzSoFmN76lKHpFLrIZclV+Nw+7F68W0UDvQk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBBC93858416 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 30FF74369A for ; Sun, 9 Nov 2025 21:54:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 664ACC19422; Sun, 9 Nov 2025 21:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725254; bh=TsxDYPwIadhO886qsSwFp/FcJCAoDTN1wauKLxRQawc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S5Af77MHYUMtIaao6XSe1obrlhanoRPs8GiVWWPNOldZnmhCjHgGksaHicIKmHSIa l4O1uNdcHdpeo17LLVOWU7qUi0NuRpn9YhiU9Rk2RtBh7qvpFod70BTW+CKmviWifv tH+XwxV27wwxG6g7G/8cqTlzAS+tBBhzl2kouhir5+T3stR0E/Em0lbRfbiBcsQLLR LHkYIVKiTwI+5i4HH2/34GuxTrxHVp0bgTmuS+nQNl4FDeRTsOMnNwYbRZQ3o9r89O XOtL9u7uQDKEKIO5GMsz9q1b7cxGvXtJTyuwz58uFLPU05cxOTSDp8oKmvK5K1PFKt /tUcF25uFU56w== Date: Sun, 9 Nov 2025 22:54:11 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 33/35] Assume __has_attribute(__cold__) Message-ID: <9ae9f9132a4a45e8bb1283f6055fa47ef19c8ae8.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for __attribute__((__cold__)) in Clang 3.2: llvm.git 29c2b4330ce0 (2012-05-12; "Add support for __attribute__((hot)) and __attribute__((cold)).") $ git describe --contains 29c2b4330ce0 llvmorg-3.2.0-rc1~1^2~9639 Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 2320f7293a..07eddbef74 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -93,11 +93,7 @@ # endif # endif -# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__) # define __COLD __attribute__ ((__cold__)) -# else -# define __COLD -# endif /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ From patchwork Sun Nov 9 21:54:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123864 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD8E83858C2C for ; Sun, 9 Nov 2025 22:18:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD8E83858C2C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eJsQn7cv X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 7CA48385841F for ; Sun, 9 Nov 2025 21:54:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CA48385841F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7CA48385841F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725257; cv=none; b=a0Q0x2Q1x/gQBoM3w5LUeUgije+vf5S3UTOctpV435xhlld+z31v0NSQcI7MyhT48di/RfiCrY0GdAqhqjlV+9S1y9KpOd523HOposfED/F6lyS4/LBwh+WaWYxUvyJPB69JSAU+JRzI2gc0j94QEuml5lp4yBQ3phEIG5p1fzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725257; c=relaxed/simple; bh=/aMPQ1hmUCMQRmlpzUr8phjjBMW8gavIPKgD+zQVJ6M=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=v4ppft6a/MOY3V3yDQE0yyfQKsJBKiG/AzxQ5zEfXpBknaQhje6dW/nmxQrzMM4QsthzHDelbhxoqYuusifSFDTBWdbLU1ZboyCBQ401sXTjSSZbpwGh7obnqDS8BJJoRc2F4np/MSTaoQhg1qjqFya6LYdxDBfTNWTDF/IjpKo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CA48385841F Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 2670A60007 for ; Sun, 9 Nov 2025 21:54:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2425FC4CEF7; Sun, 9 Nov 2025 21:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725256; bh=/aMPQ1hmUCMQRmlpzUr8phjjBMW8gavIPKgD+zQVJ6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eJsQn7cvOH1gOAAJuat2WH4yUyLkR5gXeaw0tc4KTKfsBosDcpcXzOKmco2WDc6Bn 3UIiG2eyX7hi2gpMUEenuUDXT8TBGz6LxiEbLZ0h3DFrWzD9Gf89JTAWJJGSKYwdA7 zQB8PYhnVRg9Jye9dN2KXSjuL+C7kHOvngDIZKcIQ6gXnAh7B82DsamwAVRclvOPPu sk7QAGUjJIscpLvBPDL5d6BEgptat8w8tyPd+sHMTlCo0i7IJnwFqwwaBTBuLgYvr9 oBJ7Kf2uVMOTPfGlCgo7zd92WVOZFA07CTtl4kCpuTdzdCLYHgPbSmxsUOfJJsI/3s W8MUqxW5E+UJw== Date: Sun, 9 Nov 2025 22:54:14 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 34/35] Assume __has_attribute(__alloc_size__) Message-ID: <3f10377c9423e0ab4df4cc0ba151e9e91fa5b974.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for __attribute__((__alloc_size__())) in Clang 4.0.0: llvm.git a747027bc645 (2016-12-20; "Add the alloc_size attribute to clang.") $ git describe --contains a747027bc645 llvmorg-4.0.0-rc1~1659 Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 07eddbef74..76ee6c275e 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -382,12 +382,8 @@ /* Tell the compiler which arguments to an allocation function indicate the size of the allocation. */ -#if __GNUC_PREREQ (4, 3) # define __attribute_alloc_size__(params) \ __attribute__ ((__alloc_size__ params)) -#else -# define __attribute_alloc_size__(params) /* Ignore. */ -#endif /* Tell the compiler which argument to an allocation function indicates the alignment of the allocation. */ From patchwork Sun Nov 9 21:54:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123866 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D33E63858039 for ; Sun, 9 Nov 2025 22:19:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id 14B913858408 for ; Sun, 9 Nov 2025 21:54:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14B913858408 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14B913858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725260; cv=none; b=apbF+LtSQlIUuahEwXsmq7Yz+Ri71obTWAciJ/1Y5AYAXq9MBlTpq/p9GYaTRtfYneQCLGRHBX76G4KBi7VxiIV66WostvyFCnuj4YRk0TtqHnmIamCevMadkZf9CDD85nY8KsDwAIDbMgIl9T1cABZMcfSlz5ULdUcNTv/oWiY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725260; c=relaxed/simple; bh=uylC1IX6x0Al+4MlYCWjFaR+vvh6na8p6Of2i0SQiuw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=qo89aoYv+NFb/A1JQqmxChBbfVEVokpV+JlsbL2yJz7yEOCueFNMsNW84TqcW08Qf6a+L3Iyk3/4fjBUIRdILe5D9fa+bjnaaaP9mRDRUwVxcPJYvly0++CkLkEuiio1fIwXa4QEWcDXInFcMbCD2l4MTpWl+ZBintuuLYjcLAY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14B913858408 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=bjtyYBJq Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 8007B438F3 for ; Sun, 9 Nov 2025 21:54:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B666AC4CEFB; Sun, 9 Nov 2025 21:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725259; bh=uylC1IX6x0Al+4MlYCWjFaR+vvh6na8p6Of2i0SQiuw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bjtyYBJq1HLiAikA/LZCdeUxWdVr+qkuzzF4bsnSMeVhN6wCqX3HWcSTHqJtQ6yF5 uitFA6BGkGWwUidkiLRVqK3GYwO+MTfyMsc9HgP3QnoUWAmdHaRzgtiOZiQprOwVHY NTbdhGj0Uicp4zata/nkfjGkGHedHUaP+cFnWYT+XygkQJ42SGzEuIahcQR1rZJfBA C3iCBVF7VeEsxddM8fdtowLil/ohr6EWmUhZxI5wk1t7TS1a5fgZlbD1PONCkXnh9I FedYb8T3Qel8UItVZZCj1e7g6JfKI90/Wta2d5Z2CFZeK9pW9Nq2VcU+r3E1yN4djK LBnyg9dfqeQSQ== Date: Sun, 9 Nov 2025 22:54:17 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 35/35] Assume __has_attribute(__returns_nonnull__) Message-ID: <2f9af1cf855c52178fdd16c21d6998ba5c94da75.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for __attribute__((__returns_nonnull__)) in Clang 3.5: llvm.git dbf62e3eee51 (2014-01-20; "Wire up basic parser/sema support for attribute 'returns_nonnull'.") $ git describe --contains dbf62e3eee51 llvmorg-3.5.0-rc1~13296 Signed-off-by: Alejandro Colomar --- misc/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 76ee6c275e..afb44fda6c 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -439,11 +439,7 @@ /* The returns_nonnull function attribute marks the return type of the function as always being non-null. */ #ifndef __returns_nonnull -# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__) # define __returns_nonnull __attribute__ ((__returns_nonnull__)) -# else -# define __returns_nonnull -# endif #endif /* If fortification mode, we warn about unused results of certain