[PATCH v1 01/35] Assume __GNUC__

Alejandro Colomar alx@kernel.org
Sun Nov 9 21:52:46 GMT 2025


Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 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 <config.h>
 #endif
 
-/* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H || defined _LIBC
-#  include <alloca.h>
-# else
-#  ifdef _AIX
-#pragma alloca
-#  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#   endif
-#  endif
-# endif
-#endif
-
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -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 <op> 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 <limits.h>
 #endif
@@ -127,7 +127,7 @@
 /* The <limits.h> 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 <sys/types.h>
 
-#ifdef __GNUC__
 # define alloca __builtin_alloca
 # define HAVE_ALLOCA 1
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  if defined HAVE_ALLOCA_H || defined _LIBC
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif
-#  endif
-# endif
-#endif
 
 #include <errno.h>
 #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 <limits.h>
 #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 <sys/types.h>
 
-#ifdef __GNUC__
 # undef alloca
 # define alloca __builtin_alloca
 # define HAVE_ALLOCA 1
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  if defined HAVE_ALLOCA_H || defined _LIBC
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif
-#  endif
-# endif
-#endif
 
 #include <stdlib.h>
 #include <string.h>
@@ -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 <plural-exp.h>
 
-#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 <https://www.gnu.org/licenses/>.  */
 
-/* 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 <config.h>
-   because <config.h> 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 <config.h>
 #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 <config.h>
 #endif
 
-#if __GNUC__
 # define alloca __builtin_alloca
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #  pragma alloca
-#  else
-char *alloca ();
-#  endif
-# endif
-#endif
 
 #ifdef _LIBC
 # include <dirent.h>
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 <stdio.h>
 
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 <stdarg.h>
-# 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 <stdio.h> 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 <stdio.h> 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 <bits/libc-header-start.h>
 
-#if defined log && defined __GNUC__
+#if defined log
 # warning A macro called log was already defined when <math.h> 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 <bits/select2.h>
 #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 <locale/localeinfo.h>
 #include <scratch_buffer.h>
 
-#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
 <https://www.gnu.org/licenses/>.  */
 
 /* 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 <sys/param.h>
 
@@ -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
    <https://www.gnu.org/licenses/>.  */
 
-#if defined _AIX && !defined __GNUC__
- #pragma alloca
-#endif
-
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -38,11 +34,7 @@
 # ifdef HAVE_ALLOCA_H
 #  include <alloca.h>
 # 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 <search.h>
 
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 <stdlib.h>
 #include <malloc.h>
 
-#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 <setjmp.h>
 #include <stdlib.h>
 
-#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 <sgidefs.h>
 #include <stdlib.h>
 
-#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 <stdarg.h>
 
 #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 <stdarg.h>
-# endif
 #endif
 
 #include <bits/wchar.h>
-- 
2.51.0



More information about the Libc-alpha mailing list