]> Savannah Git Hosting - gnulib.git/commitdiff
Explicitly exclude clang when we test for a GCC version >= 4.3.
authorBruno Haible <bruno@clisp.org>
Tue, 27 Aug 2024 14:20:16 +0000 (16:20 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 17 Sep 2024 10:58:14 +0000 (12:58 +0200)
Rationale: clang can disguise as any possible GCC version.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__,
exclude clang.
* lib/_Noreturn.h (_Noreturn): Likewise.
* lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise.
* lib/base32.h: Likewise.
* lib/base64.h: Likewise.
* lib/dfa.c (FALLTHROUGH): Likewise.
* lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise.
* lib/intprops-internal.h: Likewise.
* lib/jit/cache.h (clear_cache): Likewise.
* lib/malloc.in.h (memalign): Likewise.
* lib/mcel.h: Likewise.
* lib/regex.h: Likewise.
* lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile):
Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc,
canonicalize_file_name, malloc, realloc): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise.
* lib/verify.h: Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise.
* lib/xalloc-oversized.h (xalloc_oversized): Likewise.
* lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR,
_FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different
builtins for clang.
* lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude
clang. Enable for clang >= 4.
* lib/astrxfrm.c: Use _GL_GNUC_PREREQ.
* lib/readutmp.c: Likewise.
* lib/strftime.c: Likewise.
* tests/test-asyncsafe-linked_list-strong.c: Likewise.
* tests/test-asyncsafe-linked_list-weak.c: Likewise.
* tests/test-c-strtod-mt.c: Likewise.
* tests/test-c-strtof-mt.c: Likewise.
* tests/test-c-strtold-mt.c: Likewise.
* tests/test-gmtime_r-mt.c: Likewise.
* tests/test-intprops.c: Likewise.
* tests/test-limits-h.c: Likewise.
* tests/test-localtime_r-mt.c: Likewise.
* tests/test-memrchr.c: Likewise.
* tests/test-nl_langinfo-mt.c: Likewise.
* tests/test-setlocale_null-mt-all.c: Likewise.
* tests/test-setlocale_null-mt-one.c: Likewise.
* tests/test-statat.c: Likewise.
* tests/test-xvasprintf.c: Likewise.

40 files changed:
ChangeLog
lib/_Noreturn.h
lib/aligned-malloc.h
lib/astrxfrm.c
lib/base32.h
lib/base64.h
lib/dfa.c
lib/dirent.in.h
lib/fenv-private.h
lib/hamt.h
lib/intprops-internal.h
lib/jit/cache.h
lib/malloc.in.h
lib/mcel.h
lib/readutmp.c
lib/regex.h
lib/stddef.in.h
lib/stdio.in.h
lib/stdlib.in.h
lib/strftime.c
lib/string.in.h
lib/verify.h
lib/wchar.in.h
lib/xalloc-oversized.h
m4/gnulib-common.m4
tests/test-asyncsafe-linked_list-strong.c
tests/test-asyncsafe-linked_list-weak.c
tests/test-c-strtod-mt.c
tests/test-c-strtof-mt.c
tests/test-c-strtold-mt.c
tests/test-gmtime_r-mt.c
tests/test-intprops.c
tests/test-limits-h.c
tests/test-localtime_r-mt.c
tests/test-memrchr.c
tests/test-nl_langinfo-mt.c
tests/test-setlocale_null-mt-all.c
tests/test-setlocale_null-mt-one.c
tests/test-statat.c
tests/test-xvasprintf.c

index e67b41fa6bcccc297de8c35bd564b7dc736ab7e0..e84f67b639e5ac1254c9ad8a3673d9badb323692 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2024-08-27  Bruno Haible  <bruno@clisp.org>
+
+       Explicitly exclude clang when we test for a GCC version >= 4.3.
+       Rationale: clang can disguise as any possible GCC version.
+       * m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__,
+       exclude clang.
+       * lib/_Noreturn.h (_Noreturn): Likewise.
+       * lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise.
+       * lib/base32.h: Likewise.
+       * lib/base64.h: Likewise.
+       * lib/dfa.c (FALLTHROUGH): Likewise.
+       * lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise.
+       * lib/intprops-internal.h: Likewise.
+       * lib/jit/cache.h (clear_cache): Likewise.
+       * lib/malloc.in.h (memalign): Likewise.
+       * lib/mcel.h: Likewise.
+       * lib/regex.h: Likewise.
+       * lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise.
+       * lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile):
+       Likewise.
+       * lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc,
+       canonicalize_file_name, malloc, realloc): Likewise.
+       * lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise.
+       * lib/verify.h: Likewise.
+       * lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise.
+       * lib/xalloc-oversized.h (xalloc_oversized): Likewise.
+       * lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR,
+       _FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different
+       builtins for clang.
+       * lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude
+       clang. Enable for clang >= 4.
+       * lib/astrxfrm.c: Use _GL_GNUC_PREREQ.
+       * lib/readutmp.c: Likewise.
+       * lib/strftime.c: Likewise.
+       * tests/test-asyncsafe-linked_list-strong.c: Likewise.
+       * tests/test-asyncsafe-linked_list-weak.c: Likewise.
+       * tests/test-c-strtod-mt.c: Likewise.
+       * tests/test-c-strtof-mt.c: Likewise.
+       * tests/test-c-strtold-mt.c: Likewise.
+       * tests/test-gmtime_r-mt.c: Likewise.
+       * tests/test-intprops.c: Likewise.
+       * tests/test-limits-h.c: Likewise.
+       * tests/test-localtime_r-mt.c: Likewise.
+       * tests/test-memrchr.c: Likewise.
+       * tests/test-nl_langinfo-mt.c: Likewise.
+       * tests/test-setlocale_null-mt-all.c: Likewise.
+       * tests/test-setlocale_null-mt-one.c: Likewise.
+       * tests/test-statat.c: Likewise.
+       * tests/test-xvasprintf.c: Likewise.
+
 2024-08-27  Bruno Haible  <bruno@clisp.org>
 
        readutmp: In systemd mode, show sessions of type "web".
index 7326bd477331b4acbe93a119f3cc86b5ea3148b8..9806f2b1a092ef857a8c7a0b3f3dfd0948ab402c 100644 (file)
@@ -34,7 +34,7 @@
 # elif ((!defined __cplusplus || defined __clang__) \
         && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
             || (!defined __STRICT_ANSI__ \
-                && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+                && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __clang__ \
                     || (defined __apple_build_version__ \
                         ? 6000000 <= __apple_build_version__ \
                         : 3 < __clang_major__ + (5 <= __clang_minor__))))))
index d7142f5a8c2dd21588f6811e8871e9a284521a9c..87d1ec1c67c5674db39f4065427d4a1073b41e22 100644 (file)
@@ -64,7 +64,7 @@ extern "C" {
 #endif
 #if ((ALIGNMENT) <= MALLOC_ALIGNMENT) || HAVE_POSIX_MEMALIGN || HAVE_ALIGNED_ALLOC || HAVE_MEMALIGN
 
-# if defined aligned_free || __GNUC__ >= 11
+# if defined aligned_free || (__GNUC__ >= 11 && !defined __clang__)
    /* The caller wants an inline function, not a macro,
       or we can use GCC's -Wmismatched-dealloc warning.  */
 static inline void
@@ -79,7 +79,7 @@ aligned_free (void *q)
 # if (ALIGNMENT) <= MALLOC_ALIGNMENT
 /* Simply use malloc.  */
 
-#  if defined aligned_malloc || __GNUC__ >= 11
+#  if defined aligned_malloc || (__GNUC__ >= 11 && !defined __clang__)
    /* The caller wants an inline function, not a macro,
       or GCC's -Wmismatched-dealloc warning might be in effect.  */
 static inline
index eaedff0a8314c6121cf2835a18070fe7902be6d2..f25cf7d4932149cf06dae213885a8271c60a023f 100644 (file)
@@ -26,7 +26,7 @@
 
 /* Avoid false GCC warning "function may return address of local variable"
    regarding result and tmpbuf.  */
-#if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4
+#if _GL_GNUC_PREREQ (4, 8)
 # pragma GCC diagnostic ignored "-Wreturn-local-addr"
 #endif
 
index eadbeae56c1d5aa1d9ff278982f833d8fc957b25..8c10948c3764d8e6b605f427a77f0bccf89b3b12 100644 (file)
@@ -27,7 +27,7 @@
 #include <idx.h>
 
 /* Pacify GCC in isubase32.  */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
 # pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
index 7691f6c4ade67e1fd60ccf1fb6b72cb2fa3917b4..562ba97302f6e1a74aab60b188884a99f0a17a33 100644 (file)
@@ -27,7 +27,7 @@
 #include <idx.h>
 
 /* Pacify GCC in isubase64.  */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
 # pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
index 0ccb1671766ca8ecf606461487ea25c80101ded5..a7a969b6ca55c44ffc6dfe2c91ae4a327751d1a3 100644 (file)
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -80,7 +80,7 @@ c_isdigit (char c)
 #ifndef FALLTHROUGH
 # if 201710L < __STDC_VERSION__
 #  define FALLTHROUGH [[__fallthrough__]]
-# elif ((__GNUC__ >= 7) \
+# elif ((__GNUC__ >= 7 && !defined __clang__) \
         || (defined __apple_build_version__ \
             ? __apple_build_version__ >= 12000000 \
             : __clang_major__ >= 10))
index f05b880077f619401a51076a00ca69a8c2ec8519..3fe46f2336f22f15cc29ecb56d4dd833dac93f99 100644 (file)
@@ -78,7 +78,7 @@ typedef struct gl_directory DIR;
    that can be freed by passing them as the Ith argument to the
    function F.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
 # else
 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -152,7 +152,7 @@ _GL_FUNCDECL_RPL (opendir, DIR *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
 _GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
 # else
-#  if !@HAVE_OPENDIR@ || __GNUC__ >= 11
+#  if !@HAVE_OPENDIR@ || (__GNUC__ >= 11 && !defined __clang__)
 _GL_FUNCDECL_SYS (opendir, DIR *,
                   (const char *dir_name)
                   _GL_ARG_NONNULL ((1))
@@ -162,7 +162,8 @@ _GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
 # endif
 _GL_CXXALIASWARN (opendir);
 #else
-# if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR && __GNUC__ >= 11 && !defined opendir
+# if @GNULIB_CLOSEDIR@ && !GNULIB_defined_DIR \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined opendir
 /* For -Wmismatched-dealloc: Associate opendir with closedir or
    rpl_closedir.  */
 _GL_FUNCDECL_SYS (opendir, DIR *,
@@ -274,7 +275,8 @@ _GL_FUNCDECL_RPL (fdopendir, DIR *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
 _GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
 # else
-#  if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ || __GNUC__ >= 11
+#  if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@ \
+      || (__GNUC__ >= 11 && !defined __clang__)
 _GL_FUNCDECL_SYS (fdopendir, DIR *,
                   (int fd)
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1));
@@ -283,7 +285,8 @@ _GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
 # endif
 _GL_CXXALIASWARN (fdopendir);
 #else
-# if @GNULIB_CLOSEDIR@ && __GNUC__ >= 11 && !defined fdopendir
+# if @GNULIB_CLOSEDIR@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined fdopendir
 /* For -Wmismatched-dealloc: Associate fdopendir with closedir or
    rpl_closedir.  */
 _GL_FUNCDECL_SYS (fdopendir, DIR *,
index e92c9de22877019967e01f5cae1c8ffa8f86ce20..9571b7b93d6719928ad3cedc050ac35936fc4245 100644 (file)
@@ -133,9 +133,12 @@ x86_387_fenv_t;
    occurring, trigger a trap rather than merely set the corresponding bit
    in the fpsr register.  */
 
-# if __GNUC__ >= 6
+# if __GNUC__ >= 6 && !defined __clang__
 #  define _FPU_GETCW(fpcr) (fpcr = __builtin_aarch64_get_fpcr ())
 #  define _FPU_SETCW(fpcr) __builtin_aarch64_set_fpcr (fpcr)
+# elif __clang_major__ >= 4
+#  define _FPU_GETCW(fpcr) (fpcr = __builtin_arm_rsr ("fpcr"))
+#  define _FPU_SETCW(fpcr) __builtin_arm_wsr ("fpcr", fpcr)
 # else
 #  define _FPU_GETCW(fpcr) \
    __asm__ __volatile__ ("mrs %0, fpcr" : "=r" (fpcr))
@@ -143,9 +146,12 @@ x86_387_fenv_t;
    __asm__ __volatile__ ("msr fpcr, %0" : : "r" (fpcr))
 # endif
 
-# if __GNUC__ >= 6
+# if __GNUC__ >= 6 && !defined __clang__
 #  define _FPU_GETFPSR(fpsr) (fpsr = __builtin_aarch64_get_fpsr ())
 #  define _FPU_SETFPSR(fpsr) __builtin_aarch64_set_fpsr (fpsr)
+# elif __clang_major__ >= 4
+#  define _FPU_GETFPSR(fpsr) (fpsr = __builtin_arm_rsr ("fpsr"))
+#  define _FPU_SETFPSR(fpsr) __builtin_arm_wsr ("fpsr", fpsr)
 # else
 #  define _FPU_GETFPSR(fpsr) \
    __asm__ __volatile__ ("mrs %0, fpsr" : "=r" (fpsr))
index a25c6127311254889d9104959976a0bd34bae0a7..b483aa1bbef517c893cabbefae08cbb0e7d06560 100644 (file)
@@ -61,9 +61,10 @@ _GL_INLINE_HEADER_BEGIN
    the same hamt.  This is non-trivial as different hamts may share
    some structure.
    We can define it only when the compiler supports _Atomic.  For GCC,
-   it is supported starting with GCC 4.9.  */
+   it is supported starting with GCC 4.9.  For clang, with clang 4.  */
 
-#if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4) \
+#if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang \
+     || __clang_major__ >= 4) \
     && __STDC_VERSION__ >= 201112L && !defined __STD_NO_ATOMICS__ \
     && !defined __cplusplus
 # define GL_HAMT_THREAD_SAFE 1
index 443024c66573c6f484254a40c5fc946412650271..c8cc0e20194db34f40353b1818f3c9e7529487f4 100644 (file)
@@ -21,7 +21,7 @@
 #include <limits.h>
 
 /* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED.  */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
 # pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
 #if _GL_HAS_BUILTIN_MUL_OVERFLOW
 # if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
        || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
-      && !defined __EDG__)
+      && !defined __clang__ && !defined __EDG__)
 #  define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
 # else
    /* Work around GCC bug 91450.  */
index 94aef3052695486099db307f967183cf22ec19db..16835d5e00d44c703be449a3c891f2f7b56c52fe 100644 (file)
@@ -167,7 +167,7 @@ clear_cache (void *start, void *end)
     : "d" (addr), "d" (len)
     : "%d0", "%d2", "%d3"
     );
-#elif (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4) \
+#elif (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) \
       || ((__clang_major__ + (__clang_minor__ >= 4) > 3) \
           && (defined __aarch64__ /* arm64 */ || defined __arm__))
   /* GCC >= 4.3 has a GCC built-in.
index a08f21fb84f1a6c7868b81792169c0a1022550ed..59e9c7b2e4bccecb3cdcd1e19bf8e5c2baf317ae 100644 (file)
@@ -147,7 +147,7 @@ _GL_FUNCDECL_RPL (memalign, void *,
 _GL_CXXALIAS_RPL (memalign, void *, (size_t alignment, size_t size));
 # else
 #  if @HAVE_MEMALIGN@
-#   if __GNUC__ >= 11
+#   if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate memalign with free or rpl_free.  */
 #    if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (memalign, void *,
@@ -167,7 +167,7 @@ _GL_CXXALIAS_SYS (memalign, void *, (size_t alignment, size_t size));
 _GL_CXXALIASWARN (memalign);
 # endif
 #else
-# if __GNUC__ >= 11 && !defined memalign
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined memalign
 /* For -Wmismatched-dealloc: Associate memalign with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (memalign, void *,
index d9f8385155af7fdf050c0716851d219e1fb0366c..e5b0765bff7e00699c2f793122cb3823ddfdae87 100644 (file)
@@ -109,7 +109,7 @@ extern "C" {
 
 
 /* Pacify GCC re type limits.  */
-#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
 # pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
 
index 3c4f97b146fa79f6aae9b3fa298b0e13eb69d34b..0938a094cb4c63c05c8288f4a38f32f0af7cfc8d 100644 (file)
 /* Size of the ut->ut_host member.  */
 #define UT_HOST_SIZE  sizeof (((struct UTMP_STRUCT_NAME *) 0)->ut_host)
 
-#if 8 <= __GNUC__
+#if _GL_GNUC_PREREQ (8, 0)
 # pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess"
 #endif
 
index ccf40cebc0efdab0f183aba4c60d7d660ebe36d3..71a45f8c27f3a347db2bfa53e01b266aba407acd 100644 (file)
@@ -531,7 +531,8 @@ typedef struct
 # endif
 #endif
 
-#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+#if (defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+     && !defined __clang__)
 # pragma GCC diagnostic push
 # pragma GCC diagnostic ignored "-Wvla"
 #endif
@@ -539,7 +540,7 @@ typedef struct
 #ifndef _Attr_access_
 # ifdef __attr_access
 #  define _Attr_access_(arg) __attr_access (arg)
-# elif defined __GNUC__ && 10 <= __GNUC__
+# elif defined __GNUC__ && 10 <= __GNUC__ && !defined __clang__
 #  define _Attr_access_(x) __attribute__ ((__access__ x))
 # else
 #  define _Attr_access_(x)
@@ -688,7 +689,8 @@ 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 (defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+     && !defined __clang__)
 # pragma GCC diagnostic pop
 #endif
 
index 49449315cfdcceb9aa18496b4887e2df0eb8a7ef..e39268c60c90d3d2ebbfaed5410ffcaff584aded 100644 (file)
@@ -194,7 +194,7 @@ typedef union
 # ifndef _GL_HAS_BUILTIN_UNREACHABLE
 #  if defined __clang_major__ && __clang_major__ < 5
 #   define _GL_HAS_BUILTIN_UNREACHABLE 0
-#  elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+#  elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
 #   define _GL_HAS_BUILTIN_UNREACHABLE 1
 #  elif defined __has_builtin
 #   define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
index dd9eecac07ecc8189751350902f3d68ee88d9b44..08cae187efccb811063661de2335550ae2f96791 100644 (file)
    that can be freed by passing them as the Ith argument to the
    function F.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
 # else
 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -391,7 +391,7 @@ _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
 #  endif
 _GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose.  */
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (fdopen, FILE *,
@@ -410,7 +410,7 @@ _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
 # endif
 _GL_CXXALIASWARN (fdopen);
 #else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined fdopen
 /* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (fdopen, FILE *,
@@ -539,7 +539,7 @@ _GL_FUNCDECL_RPL (fopen, FILE *,
 _GL_CXXALIAS_RPL (fopen, FILE *,
                   (const char *restrict filename, const char *restrict mode));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose.  */
 _GL_FUNCDECL_SYS (fopen, FILE *,
                   (const char *restrict filename, const char *restrict mode)
@@ -552,7 +552,7 @@ _GL_CXXALIAS_SYS (fopen, FILE *,
 _GL_CXXALIASWARN (fopen);
 # endif
 #else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
+# if @GNULIB_FCLOSE@ && (__GNUC__ >= 11 && !defined __clang__) && !defined fopen
 /* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose.  */
 _GL_FUNCDECL_SYS (fopen, FILE *,
                   (const char *restrict filename, const char *restrict mode)
@@ -1241,7 +1241,7 @@ _GL_FUNCDECL_RPL (popen, FILE *,
                   _GL_ATTRIBUTE_MALLOC);
 _GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
 # else
-#  if !@HAVE_POPEN@ || __GNUC__ >= 11
+#  if !@HAVE_POPEN@ || (__GNUC__ >= 11 && !defined __clang__)
 _GL_FUNCDECL_SYS (popen, FILE *,
                   (const char *cmd, const char *mode)
                   _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1)
@@ -1251,7 +1251,8 @@ _GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
 # endif
 _GL_CXXALIASWARN (popen);
 #else
-# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
+# if @GNULIB_PCLOSE@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined popen
 /* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose.  */
 _GL_FUNCDECL_SYS (popen, FILE *,
                   (const char *cmd, const char *mode)
@@ -1659,7 +1660,7 @@ _GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
                                    _GL_ATTRIBUTE_MALLOC);
 _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose.  */
 _GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
                                    _GL_ATTRIBUTE_DEALLOC (fclose, 1)
@@ -1671,7 +1672,8 @@ _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
 _GL_CXXALIASWARN (tmpfile);
 # endif
 #else
-# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
+# if @GNULIB_FCLOSE@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined tmpfile
 /* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose.  */
 _GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
                                    _GL_ATTRIBUTE_DEALLOC (fclose, 1)
index 96f8eb2f4c5740748563699b9fc968e1ed1b945e..1efdceec4af190094d6f3bcac82910691bbb475e 100644 (file)
@@ -132,7 +132,7 @@ struct random_data
    that can be freed by passing them as the Ith argument to the
    function F.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
 # else
 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -304,7 +304,7 @@ _GL_FUNCDECL_RPL (aligned_alloc, void *,
 _GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
 # else
 #  if @HAVE_ALIGNED_ALLOC@
-#   if __GNUC__ >= 11
+#   if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free.  */
 #    if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
 _GL_FUNCDECL_SYS (aligned_alloc, void *,
@@ -324,7 +324,8 @@ _GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
 _GL_CXXALIASWARN (aligned_alloc);
 # endif
 #else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+# if @GNULIB_FREE_POSIX@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined aligned_alloc
 /* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2
 _GL_FUNCDECL_SYS (aligned_alloc, void *,
@@ -376,7 +377,7 @@ _GL_FUNCDECL_RPL (calloc, void *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free.  */
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (calloc, void *,
@@ -395,7 +396,8 @@ _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
 _GL_CXXALIASWARN (calloc);
 # endif
 #else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+# if @GNULIB_FREE_POSIX@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined calloc
 /* For -Wmismatched-dealloc: Associate calloc with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (calloc, void *,
@@ -427,7 +429,7 @@ _GL_FUNCDECL_RPL (canonicalize_file_name, char *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
 # else
-#  if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+#  if !@HAVE_CANONICALIZE_FILE_NAME@ || (__GNUC__ >= 11 && !defined __clang__)
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (canonicalize_file_name, char *,
                   (const char *name)
@@ -449,7 +451,8 @@ _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
 # endif
 _GL_CXXALIASWARN (canonicalize_file_name);
 #else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+# if @GNULIB_FREE_POSIX@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined canonicalize_file_name
 /* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
    rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
@@ -683,7 +686,7 @@ _GL_FUNCDECL_RPL (malloc, void *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free.  */
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (malloc, void *,
@@ -702,7 +705,8 @@ _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
 _GL_CXXALIASWARN (malloc);
 # endif
 #else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+# if @GNULIB_FREE_POSIX@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined malloc
 /* For -Wmismatched-dealloc: Associate malloc with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (malloc, void *,
@@ -1445,7 +1449,7 @@ _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
                                    _GL_ATTRIBUTE_DEALLOC_FREE);
 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
 # else
-#  if __GNUC__ >= 11
+#  if __GNUC__ >= 11 && !defined __clang__
 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free.  */
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (realloc, void *,
@@ -1464,7 +1468,8 @@ _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
 _GL_CXXALIASWARN (realloc);
 # endif
 #else
-# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+# if @GNULIB_FREE_POSIX@ \
+     && (__GNUC__ >= 11 && !defined __clang__) && !defined realloc
 /* For -Wmismatched-dealloc: Associate realloc with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2
 _GL_FUNCDECL_SYS (realloc, void *,
index 9b1b27a1fc8673a92d20892aa8f0b1cda1302f26..4ddbec04269e4abcc04d016d7f267a820a923336 100644 (file)
@@ -321,7 +321,7 @@ enum pad_style
    maximum object size 9223372036854775807", caused by insufficient data flow
    analysis and value propagation of the 'width_add' expansion when GCC is not
    optimizing.  Cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443>.  */
-#if __GNUC__ >= 7 && !__OPTIMIZE__
+#if _GL_GNUC_PREREQ (7, 0) && !__OPTIMIZE__
 # pragma GCC diagnostic ignored "-Wstringop-overflow"
 #endif
 
index 613d0337d5f58c7866082a1705930d4e16aa3768..903ba6e76e807c7ea62fbeba00b691942148b72f 100644 (file)
@@ -79,7 +79,7 @@
    that can be freed by passing them as the Ith argument to the
    function F.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
 # else
 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -621,7 +621,8 @@ _GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
     /* strdup exists as a function and as a macro.  Get rid of the macro.  */
 #   undef strdup
 #  endif
-#  if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
+#  if (!@HAVE_DECL_STRDUP@ || (__GNUC__ >= 11 && !defined __clang__)) \
+      && !defined strdup
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (strdup, char *,
                   (char const *__s)
@@ -639,7 +640,7 @@ _GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
 # endif
 _GL_CXXALIASWARN (strdup);
 #else
-# if __GNUC__ >= 11 && !defined strdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strdup
 /* For -Wmismatched-dealloc: Associate strdup with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (strdup, char *,
@@ -720,7 +721,8 @@ _GL_FUNCDECL_RPL (strndup, char *,
                   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
 _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
 # else
-#  if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
+#  if !@HAVE_DECL_STRNDUP@ \
+      || ((__GNUC__ >= 11 && !defined __clang__) && !defined strndup)
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (strndup, char *,
                   (char const *__s, size_t __n)
@@ -738,7 +740,7 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
 # endif
 _GL_CXXALIASWARN (strndup);
 #else
-# if __GNUC__ >= 11 && !defined strndup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined strndup
 /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (strndup, char *,
index 978926a4918a39293184eb5423f1101af1368bcd..49a73c050888146a67ec4d4d1c04882555283a76 100644 (file)
 #ifndef __cplusplus
 # if (201112 <= __STDC_VERSION__ \
       || (!defined __STRICT_ANSI__ \
-          && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
+          && ((4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__) \
+              || 5 <= __clang_major__)))
 #  define _GL_HAVE__STATIC_ASSERT 1
 # endif
 # if (202311 <= __STDC_VERSION__ \
-      || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+      || (!defined __STRICT_ANSI__ && 9 <= __GNUC__ && !defined __clang__))
 #  define _GL_HAVE__STATIC_ASSERT1 1
 # endif
 #endif
@@ -215,7 +216,7 @@ template <int w>
 # define _GL_VERIFY(R, DIAGNOSTIC, ...) \
     extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
       [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
-# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) && !defined __clang__
 #  pragma GCC diagnostic ignored "-Wnested-externs"
 # endif
 #endif
@@ -305,7 +306,7 @@ template <int w>
 #ifndef _GL_HAS_BUILTIN_UNREACHABLE
 # if defined __clang_major__ && __clang_major__ < 5
 #  define _GL_HAS_BUILTIN_UNREACHABLE 0
-# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) && !defined __clang__
 #  define _GL_HAS_BUILTIN_UNREACHABLE 1
 # elif defined __has_builtin
 #  define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
index 4dcc422a926be5031c412b28dd7979964304896d..6bbc31da8847f8583b4d032cd9889952f6008de2 100644 (file)
@@ -95,7 +95,7 @@
    that can be freed by passing them as the Ith argument to the
    function F.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC
-# if __GNUC__ >= 11
+# if __GNUC__ >= 11 && !defined __clang__
 #  define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
 # else
 #  define _GL_ATTRIBUTE_DEALLOC(f, i)
@@ -1326,7 +1326,8 @@ _GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
 /* On Solaris 11.3, the header files declare the function in the std::
    namespace, not in the global namespace.  So, force a declaration in
    the global namespace.  */
-#  if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >= 11
+#  if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) \
+      || (__GNUC__ >= 11 && !defined __clang__)
 #   if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
                   (const wchar_t *s)
@@ -1342,7 +1343,7 @@ _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
 # endif
 _GL_CXXALIASWARN (wcsdup);
 #else
-# if __GNUC__ >= 11 && !defined wcsdup
+# if (__GNUC__ >= 11 && !defined __clang__) && !defined wcsdup
 /* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free.  */
 #  if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
 _GL_FUNCDECL_SYS (wcsdup, wchar_t *,
index 7f30f83e7693b65e4a611abde3d3df818e7f5d47..cfa527d38cefd4219b8a5ff0885d65d23adf2bf8 100644 (file)
@@ -47,7 +47,8 @@
 #if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
 # define xalloc_oversized(n, s) \
    __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
-#elif 5 <= __GNUC__ && !defined __ICC && PTRDIFF_MAX < SIZE_MAX
+#elif 5 <= __GNUC__ && !defined __clang__ && !defined __ICC \
+      && PTRDIFF_MAX < SIZE_MAX
 # define xalloc_oversized(n, s) \
    (__builtin_constant_p (n) && __builtin_constant_p (s) \
     ? __xalloc_oversized (n, s) \
index d29946b349b6f278361325812a4e4a32538c9a04..086e1f5c269f2657e88c4b2fde529c72d782fa2c 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4
-# serial 96.1
+# serial 96.2
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -1168,7 +1168,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
     dnl -Wno-unused-parameter                 >= 3            >= 3.9
     dnl
     cat > conftest.c <<\EOF
-      #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      #if (__GNUC__ >= 3 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
       -Wno-cast-qual
       -Wno-conversion
       -Wno-float-equal
@@ -1177,23 +1177,23 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
       -Wno-unused-function
       -Wno-unused-parameter
       #endif
-      #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      #if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
       -Wno-float-conversion
       #endif
-      #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      #if (__GNUC__ >= 7 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
       -Wimplicit-fallthrough
       #endif
-      #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      #if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
       -Wno-pedantic
       #endif
       #if 3 < __clang_major__ + (9 <= __clang_minor__)
       -Wno-tautological-constant-out-of-range-compare
       #endif
-      #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+      #if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3)
       -Wno-sign-conversion
       -Wno-type-limits
       #endif
-      #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+      #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__)
       -Wno-unsuffixed-float-constants
       #endif
 EOF
index d90f08288f18f18c53ded8f9dfc073bc04551978..67ba4f0b4efa003d07ee0e90f92408cd26ef1ed1 100644 (file)
@@ -44,7 +44,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index fa2e9087075533b4887ce74ab97f5243da69b636..4d9bcad58a6c507feec51ac6d4897cc76cc9bdff 100644 (file)
@@ -44,7 +44,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index f900014a2088dfe39bd182187c2b072bb6148cdb..a21cd37993ec2acc0fba271985b58826ef439b97 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index fc797f9a5212b5843db088dabf708e920d1ea783..5f18c917d2e4a5a5b9f12453aa49c1c5b44ecb2d 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index 0b48eb8bfc19c6b7780dcc58ac9c01ce7cd77a49..6468b470f4057b948a3f2a7a4e44ff2762b0ca66 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index 95a36ac682be08fb590e943fbe1bd833f58106d2..87a5e7cc59ad8df6ee9a9df705af06543fb077fd 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index 8d3b8c37e6677abbdac3b0a19440e4089fbee795..3bffc3f5a40b3a9b32a5976d7de4604c7f07ec07 100644 (file)
 
 /* Written by Paul Eggert.  */
 
+#include <config.h>
+
+#if _GL_GNUC_PREREQ (4, 3)
+
 /* Tell gcc not to warn about the long expressions that the overflow
    macros expand to, or about the (X < 0) expressions.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 # pragma GCC diagnostic ignored "-Wtype-limits"
 
@@ -28,8 +31,6 @@
 
 #endif
 
-#include <config.h>
-
 #ifdef TEST_STDCKDINT
 # include <stdckdint.h>
 #else
index 6f574c88a01c26ecfead837740590f3e3e76780e..885fe1f017c60fb3d2603ac0a5c85509bf107841 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <limits.h>
 
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 #endif
 
index 096c83eb70cb3bd401305cf2af292c29ce78cf0f..d7baeff414f085f262fc14ccda8b0a5264eb5ecc 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index a6f15ceff7239dbf5530ca6da6ce559b8784e6e8..836ed6f25da8832b64872b2f7a1d29fb767554f9 100644 (file)
@@ -28,7 +28,7 @@ SIGNATURE_CHECK (memrchr, void *, (void const *, int, size_t));
 #include "macros.h"
 
 /* Work around GCC bug 101494.  */
-#if 4 < __GNUC__ + (7 <= __GNUC_MINOR__) && __GNUC__ < 12
+#if _GL_GNUC_PREREQ (4, 7) && __GNUC__ < 12
 # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
 
index b7e16fccceeec6ccc3e1ff36684b7ab6ee25a853..2325ee91d65a64cd777c651fbda1a466e95add4d 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index d565aa03827b3514fd1a190301f81f10e79ff5de..567a289fa9c345e171883ada083cc67f131ac59d 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index cbd057f94f6d080e8334713b3ec4106155b4b179..cc504812d627acea168ccecf6a371ca53b43da41 100644 (file)
@@ -19,7 +19,7 @@
 #include <config.h>
 
 /* Work around GCC bug 44511.  */
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wreturn-type"
 #endif
 
index a093caeeb31fad6f19633f5ad22c85407ca166a2..0576f8f20487fa0ba0b5d8f22202db3c0cfa47e6 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "openat.h"
 
-#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 
index 038b0c242bad4d67e6a243fc3539b6beac3e1d8a..32b82cbb72e6ba10a9be168ee97acb3cb9d4a02b 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+#include <config.h>
+
 /* Tell GCC not to warn about the specific edge cases tested here.  */
-#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+#if _GL_GNUC_PREREQ (4, 3)
 # pragma GCC diagnostic ignored "-Wformat-zero-length"
 # pragma GCC diagnostic ignored "-Wformat-nonliteral"
 # pragma GCC diagnostic ignored "-Wformat-security"
 #endif
 
-#include <config.h>
-
 #include "xvasprintf.h"
 
 #include <stdarg.h>