summaryrefslogtreecommitdiffstats
path: root/gl/intprops-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/intprops-internal.h')
-rw-r--r--gl/intprops-internal.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/gl/intprops-internal.h b/gl/intprops-internal.h
index 7ace0cdd..0df385b9 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-2025 Free Software Foundation, Inc. 3 Copyright (C) 2001-2026 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
@@ -29,10 +29,6 @@
29 Do not evaluate E. */ 29 Do not evaluate E. */
30#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) 30#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
31 31
32/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
33 <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
34#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
35
36/* The extra casts in the following macros work around compiler bugs, 32/* The extra casts in the following macros work around compiler bugs,
37 e.g., in Cray C 5.0.3.0. */ 33 e.g., in Cray C 5.0.3.0. */
38 34
@@ -41,7 +37,7 @@
41 37
42/* Return 1 if the real expression E, after promotion, has a 38/* Return 1 if the real expression E, after promotion, has a
43 signed or floating type. Do not evaluate E. */ 39 signed or floating type. Do not evaluate E. */
44#define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) 40#define _GL_EXPR_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0)
45 41
46 42
47/* Minimum and maximum values for integer types and expressions. */ 43/* Minimum and maximum values for integer types and expressions. */
@@ -60,7 +56,7 @@
60#define _GL_INT_MAXIMUM(e) \ 56#define _GL_INT_MAXIMUM(e) \
61 (_GL_EXPR_SIGNED (e) \ 57 (_GL_EXPR_SIGNED (e) \
62 ? _GL_SIGNED_INT_MAXIMUM (e) \ 58 ? _GL_SIGNED_INT_MAXIMUM (e) \
63 : _GL_INT_NEGATE_CONVERT (e, 1)) 59 : _GL_INT_CONVERT (e, -1))
64#define _GL_SIGNED_INT_MAXIMUM(e) \ 60#define _GL_SIGNED_INT_MAXIMUM(e) \
65 (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) 61 (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
66 62
@@ -112,7 +108,7 @@
112#elif defined __has_builtin 108#elif defined __has_builtin
113# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) 109# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
114/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, 110/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
115 see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */ 111 see <https://gcc.gnu.org/PR98269>. */
116#elif 7 <= __GNUC__ 112#elif 7 <= __GNUC__
117# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 113# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
118#else 114#else
@@ -184,7 +180,7 @@
184#endif 180#endif
185 181
186/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25764. See: 182/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25764. See:
187 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 183 https://gcc.gnu.org/PR68193
188 https://github.com/llvm/llvm-project/issues/25764 184 https://github.com/llvm/llvm-project/issues/25764
189 For now, assume GCC < 14 and all Clang versions generate bogus 185 For now, assume GCC < 14 and all Clang versions generate bogus
190 warnings for _Generic. This matters only for compilers that 186 warnings for _Generic. This matters only for compilers that