summaryrefslogtreecommitdiff
path: root/gnulib-m4/stdalign.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib-m4/stdalign.m4')
-rw-r--r--gnulib-m4/stdalign.m422
1 files changed, 13 insertions, 9 deletions
diff --git a/gnulib-m4/stdalign.m4 b/gnulib-m4/stdalign.m4
index 1c29d1e4..d22360e1 100644
--- a/gnulib-m4/stdalign.m4
+++ b/gnulib-m4/stdalign.m4
@@ -1,9 +1,10 @@
# stdalign.m4
-# serial 1
-dnl Copyright 2011-2024 Free Software Foundation, Inc.
+# serial 3
+dnl Copyright 2011-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
# Check for alignas and alignof that conform to C23.
@@ -29,7 +30,7 @@ AC_DEFUN([gl_ALIGNASOF],
/* Test that alignof yields a result consistent with offsetof.
This catches GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ <https://gcc.gnu.org/PR52023>. */
#ifdef __cplusplus
template <class t> struct alignof_helper { char a; t b; };
# define ao(type) offsetof (alignof_helper<type>, b)
@@ -81,10 +82,10 @@ AC_DEFUN([gl_ALIGNASOF],
References:
ISO C23 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf>)
+ <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf>)
sections 6.5.3.4, 6.7.5, 7.15.
C++11 (latest free draft
- <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
+ <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
section 18.10. */
/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
@@ -102,12 +103,14 @@ AC_DEFUN([gl_ALIGNASOF],
want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
- <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
- clang versions < 8.0.0 have the same bug. */
+ <https://gcc.gnu.org/PR52023>.
+ clang versions < 8.0.0 have the same bug.
+ IBM XL C V16.1.0 cc (non-clang) has the same bug. */
# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
|| (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
&& !defined __clang__) \
- || (defined __clang__ && __clang_major__ < 8))
+ || (defined __clang__ && __clang_major__ < 8) \
+ || defined __xlC__)
# undef/**/_Alignof
# ifdef __cplusplus
# if (201103 <= __cplusplus || defined _MSC_VER)
@@ -178,7 +181,8 @@ AC_DEFUN([gl_ALIGNASOF],
# if ((defined _Alignas \
&& !(defined __cplusplus \
&& (201103 <= __cplusplus || defined _MSC_VER))) \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__ \
+ && !defined __xlC__))
# define alignas _Alignas
# endif
# endif