summaryrefslogtreecommitdiffstats
path: root/gl/intprops-internal.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-12-28 12:13:40 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-12-28 12:13:40 +0100
commitb0afb8fe0ff1d87165af9df61501197a06240dda (patch)
tree274ac6a96c53ef4c19ab4974ce24a06a233128c5 /gl/intprops-internal.h
parent68fc05381ee5fa0aee1413118fbb3d81ca888b09 (diff)
downloadmonitoring-plugins-b0afb8fe0ff1d87165af9df61501197a06240dda.tar.gz
Sync with Gnulib stable-202507 code (a8ac9f9ce5)
Diffstat (limited to 'gl/intprops-internal.h')
-rw-r--r--gl/intprops-internal.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/gl/intprops-internal.h b/gl/intprops-internal.h
index b5ba8d7c..7ace0cdd 100644
--- a/gl/intprops-internal.h
+++ b/gl/intprops-internal.h
@@ -1,6 +1,6 @@
1/* intprops-internal.h -- properties of integer types not visible to users 1/* intprops-internal.h -- properties of integer types not visible to users
2 2
3 Copyright (C) 2001-2024 Free Software Foundation, Inc. 3 Copyright (C) 2001-2025 Free Software Foundation, Inc.
4 4
5 This program is free software: you can redistribute it and/or modify it 5 This program is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Lesser General Public License as published 6 under the terms of the GNU Lesser General Public License as published
@@ -21,7 +21,7 @@
21#include <limits.h> 21#include <limits.h>
22 22
23/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */ 23/* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */
24#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__) 24#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
25# pragma GCC diagnostic ignored "-Wtype-limits" 25# pragma GCC diagnostic ignored "-Wtype-limits"
26#endif 26#endif
27 27
@@ -77,10 +77,11 @@
77 77
78/* Does the __typeof__ keyword work? This could be done by 78/* Does the __typeof__ keyword work? This could be done by
79 'configure', but for now it's easier to do it by hand. */ 79 'configure', but for now it's easier to do it by hand. */
80#if (2 <= __GNUC__ \ 80#if ((defined __GNUC__ && 2 <= __GNUC__) \
81 || (4 <= __clang_major__) \ 81 || (defined __clang_major__ && 4 <= __clang_major__) \
82 || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ 82 || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
83 || (0x5110 <= __SUNPRO_C && !__STDC__)) 83 || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
84 || (defined _MSC_VER && 1939 <= _MSC_VER))
84# define _GL_HAVE___TYPEOF__ 1 85# define _GL_HAVE___TYPEOF__ 1
85#else 86#else
86# define _GL_HAVE___TYPEOF__ 0 87# define _GL_HAVE___TYPEOF__ 0
@@ -119,8 +120,8 @@
119#endif 120#endif
120 121
121/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */ 122/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
122#if defined __clang_major__ && __clang_major__ < 14 123#if defined __clang_major__ && __clang_major__ < 21
123/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */ 124/* Work around Clang bug <https://github.com/llvm/llvm-project/issues/16778>. */
124# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0 125# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
125#else 126#else
126# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW 127# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
@@ -163,7 +164,7 @@
163#if _GL_HAS_BUILTIN_MUL_OVERFLOW 164#if _GL_HAS_BUILTIN_MUL_OVERFLOW
164# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ 165# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
165 || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \ 166 || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
166 && !defined __EDG__) 167 && !defined __clang__ && !defined __EDG__)
167# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) 168# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
168# else 169# else
169 /* Work around GCC bug 91450. */ 170 /* Work around GCC bug 91450. */
@@ -182,13 +183,13 @@
182 _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW) 183 _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
183#endif 184#endif
184 185
185/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: 186/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25764. See:
186 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 187 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
187 https://llvm.org/bugs/show_bug.cgi?id=25390 188 https://github.com/llvm/llvm-project/issues/25764
188 For now, assume all versions of GCC-like compilers generate bogus 189 For now, assume GCC < 14 and all Clang versions generate bogus
189 warnings for _Generic. This matters only for compilers that 190 warnings for _Generic. This matters only for compilers that
190 lack relevant builtins. */ 191 lack relevant builtins. */
191#if __GNUC__ || defined __clang__ 192#if (__GNUC__ && __GNUC__ < 14) || defined __clang__
192# define _GL__GENERIC_BOGUS 1 193# define _GL__GENERIC_BOGUS 1
193#else 194#else
194# define _GL__GENERIC_BOGUS 0 195# define _GL__GENERIC_BOGUS 0