From c593e834e1c17daf5c151ec2bdadbccc65b9efd4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 15 Jan 2023 11:48:43 -0800 Subject: [PATCH] alignasof: new module This splits off support for the C23 keywords alignas and alignof, from the now-deprecated stdalign module. The latter now merely provides C11 support. * MODULES.html.sh, NEWS, doc/gnulib.texi: * doc/posix-headers/stdalign.texi: Document the change. * lib/stdalign.in.h: Remove most of the definitions (which are now supplied by the alignasof module), leaving only __alignas_is_defined and __alignof_is_defined. * modules/alignasof, modules/alignasof-tests: New files. * m4/stdalign.m4 (gl_ALIGNASOF): New macro, with most of the contents of the old gl_STDALIGN_H. Do not define __alignas_is_defined or __alignof_is_defined. (gl_STDALIGN_H): Rely on gl_ALIGNASOF for most of the work. * modules/alignalloc, modules/alignof, modules/argp: * modules/crypto/md4-buffer, modules/crypto/md5-buffer: * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: * modules/crypto/sha512-buffer, modules/crypto/sm3-buffer: * modules/fts, modules/rawmemchr, modules/relocatable-prog-wrapper: * modules/stddef-tests, modules/sys_socket: Depend on alignasof, not stdalign. * modules/stdalign: Deprecate. Depend on alignasof. * modules/stdalign-tests: Move most contents to the new module alignasof-tests, and depend on that. --- ChangeLog | 27 +++++++ MODULES.html.sh | 1 + NEWS | 2 + doc/gnulib.texi | 7 +- doc/posix-headers/stdalign.texi | 31 +++++--- lib/stdalign.in.h | 109 ++------------------------ m4/stdalign.m4 | 127 +++++++++++++++++++++---------- modules/alignalloc | 2 +- modules/alignasof | 18 +++++ modules/alignasof-tests | 13 ++++ modules/alignof | 2 +- modules/argp | 2 +- modules/crypto/md4-buffer | 2 +- modules/crypto/md5-buffer | 2 +- modules/crypto/sha1-buffer | 2 +- modules/crypto/sha256-buffer | 2 +- modules/crypto/sha512-buffer | 2 +- modules/crypto/sm3-buffer | 2 +- modules/fts | 2 +- modules/rawmemchr | 2 +- modules/relocatable-prog-wrapper | 2 +- modules/stdalign | 7 +- modules/stdalign-tests | 7 +- modules/stddef-tests | 2 +- modules/sys_socket | 2 +- 25 files changed, 198 insertions(+), 179 deletions(-) create mode 100644 modules/alignasof create mode 100644 modules/alignasof-tests diff --git a/ChangeLog b/ChangeLog index 0dedc0c7d6..4755f19360 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2023-01-15 Paul Eggert + + alignasof: new module + This splits off support for the C23 keywords alignas and alignof, + from the now-deprecated stdalign module. The latter now merely + provides C11 support. + * MODULES.html.sh, NEWS, doc/gnulib.texi: + * doc/posix-headers/stdalign.texi: Document the change. + * lib/stdalign.in.h: Remove most of the definitions (which are now + supplied by the alignasof module), leaving only + __alignas_is_defined and __alignof_is_defined. + * modules/alignasof, modules/alignasof-tests: New files. + * m4/stdalign.m4 (gl_ALIGNASOF): New macro, with + most of the contents of the old gl_STDALIGN_H. + Do not define __alignas_is_defined or __alignof_is_defined. + (gl_STDALIGN_H): Rely on gl_ALIGNASOF for most of the work. + * modules/alignalloc, modules/alignof, modules/argp: + * modules/crypto/md4-buffer, modules/crypto/md5-buffer: + * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: + * modules/crypto/sha512-buffer, modules/crypto/sm3-buffer: + * modules/fts, modules/rawmemchr, modules/relocatable-prog-wrapper: + * modules/stddef-tests, modules/sys_socket: + Depend on alignasof, not stdalign. + * modules/stdalign: Deprecate. Depend on alignasof. + * modules/stdalign-tests: Move most contents to the new module + alignasof-tests, and depend on that. + 2023-01-15 Bruno Haible fpending: Fix compilation error with NDK ≥ r14b and Android API < 23. diff --git a/MODULES.html.sh b/MODULES.html.sh index 185e390440..937e9c02d8 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2383,6 +2383,7 @@ func_all_modules () func_echo "$element" func_begin_table + func_module alignasof func_module stdckdint func_end_table diff --git a/NEWS b/NEWS index f960dd978f..b54781a6f8 100644 --- a/NEWS +++ b/NEWS @@ -74,6 +74,8 @@ User visible incompatible changes Date Modules Changes +2023-01-15 stdalign This module is deprecated. Use alignasof instead. + 2023-01-07 timer_time Link with $(TIMER_TIME_LIB) instead of $(LIB_TIMER_TIME). diff --git a/doc/gnulib.texi b/doc/gnulib.texi index 0f645206bf..7388fb0b45 100644 --- a/doc/gnulib.texi +++ b/doc/gnulib.texi @@ -873,10 +873,10 @@ substituted by Gnulib. @node alignof @section @code{alignof} and @code{alignas} -Gnulib module: stdalign +Gnulib module: alignasof -The @code{stdalign} module arranges for @code{alignas}, @code{alignof}, and -@code{} to be more like standard C@. @xref{stdalign.h}. +The @code{alignasof} module arranges for @code{alignas} and @code{alignof} +to be more like standard C@. Portability problems fixed by Gnulib: @itemize @@ -886,6 +886,7 @@ Pre-C11 platforms lack @code{alignas} and @code{alignof}. @item On pre-C23 platforms, @code{} must be included before using @code{alignas} or @code{alignof}. +@xref{stdalign.h}. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-headers/stdalign.texi b/doc/posix-headers/stdalign.texi index be3cec80d1..7f75a15540 100644 --- a/doc/posix-headers/stdalign.texi +++ b/doc/posix-headers/stdalign.texi @@ -1,15 +1,17 @@ @node stdalign.h @section @file{stdalign.h} -POSIX specification:@* Not in POSIX yet, but we expect it will be. -ISO C11 (latest free draft -@url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf}) +POSIX specification:@* Not in POSIX yet, but we expect it will be, +at least temporarily until it becomes obsolete due to its phasing +out starting in C23. +ISO C23 (latest free draft +@url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf}) sections 6.5.3.4, 6.7.5, 7.15. C++11 (latest free draft @url{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf}) section 18.10. -Gnulib module: stdalign +Gnulib module: alignasof Portability problems fixed by Gnulib: @itemize @@ -17,6 +19,10 @@ Portability problems fixed by Gnulib: On older C platforms @code{} must be included before using @code{alignas} or @code{alignof}. For example, GCC versions before 13 do not support these keywords, which were standardized by C23. +On C23 and later platforms, @code{} has no effect and need +not be included. (Gnulib-using code should not include +@code{} without also employing Gnulib's now-deprecated +@code{stdalign} module.) @item This header file is missing on many platforms: FreeBSD 6.4, NetBSD 7.1, OpenBSD 6.7, Minix 3.3.0, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, mingw, MSVC 14, Android 9.0. @@ -30,6 +36,15 @@ Older C platforms might not support the obsolescent @code{_Alignas} and @code{_Alignof} keywords or macros. This portability problem should not matter with code using this module, as such code should use @code{alignas} and @code{alignof} instead. +@item +In C11 and C17, @code{} defines the macros +@code{__alignas_is_defined} and +@code{__alignof_is_defined} to 1. +In C23, these macros are not defined. +This portability problem should not matter with code using Gnulib's +@code{alignasof} module, as such code should use @code{alignas} and +@code{alignof} without checking these two macros. (Gnulib's +now-deprecated @code{stdalign} module defines these two macros.) @end itemize Portability problems not fixed by Gnulib: @@ -66,14 +81,6 @@ external variables that are declared close together with @code{alignas}. The bug is fixed in Sun C 5.15, also known as Oracle Developer Studio 12.6 (2017). @item -@code{} must be #included before @code{_Alignas} and -@code{_Alignof} can be used. -@item -In C11 and C17, @code{} defines the macros -@code{__alignas_is_defined} and -@code{__alignof_is_defined} to 1. -In C23, these macros are not defined. -@item You cannot assume that @code{alignas} and @code{alignof} are reserved words; they might be macros. @end itemize diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index 17357810c7..6523546f16 100644 --- a/lib/stdalign.in.h +++ b/lib/stdalign.in.h @@ -17,117 +17,18 @@ /* Written by Paul Eggert and Bruno Haible. */ +/* Define two obsolescent C11 macros, assuming alignas and alignof are + either keywords or alignasof-defined macros. */ + #ifndef _GL_STDALIGN_H #define _GL_STDALIGN_H -/* ISO C11 for platforms that lack it. - - References: - ISO C11 (latest free draft - ) - sections 6.5.3.4, 6.7.5, 7.15. - C++11 (latest free draft - ) - section 18.10. */ - -/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment - requirement of a structure member (i.e., slot or field) that is of - type TYPE, as an integer constant expression. - - This differs from GCC's and clang's __alignof__ operator, which can - yield a better-performing alignment for an object of that type. For - example, on x86 with GCC and on Linux/x86 with clang, - __alignof__ (double) and __alignof__ (long long) are 8, whereas - alignof (double) and alignof (long long) are 4 unless the option - '-malign-double' is used. - - The result cannot be used as a value for an 'enum' constant, if you - want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */ - -/* FreeBSD 9.1 , included by and lots of other - standard headers, defines conflicting implementations of _Alignas - and _Alignof that are no better than ours; override them. */ -#undef _Alignas -#undef _Alignof - -/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 - . - clang versions < 8.0.0 have the same bug. */ -#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ - || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ - && !defined __clang__) \ - || (defined __clang__ && __clang_major__ < 8)) -# ifdef __cplusplus -# if (201103 <= __cplusplus || defined _MSC_VER) -# define _Alignof(type) alignof (type) -# else - template struct __alignof_helper { char __a; __t __b; }; -# define _Alignof(type) offsetof (__alignof_helper, __b) -# define _GL_STDALIGN_NEEDS_STDDEF 1 -# endif -# else -# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) -# define _GL_STDALIGN_NEEDS_STDDEF 1 -# endif -#endif -#if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)) -# define alignof _Alignof -#endif -#define __alignof_is_defined 1 - -/* alignas (A), also known as _Alignas (A), aligns a variable or type - to the alignment A, where A is an integer constant expression. For - example: - - int alignas (8) foo; - struct s { int a; int alignas (8) bar; }; - - aligns the address of FOO and the offset of BAR to be multiples of 8. - - A should be a power of two that is at least the type's alignment - and at most the implementation's alignment limit. This limit is - 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable - to MSVC through at least version 10.0, A should be an integer - constant, as MSVC does not support expressions such as 1 << 3. - To be portable to Sun C 5.11, do not align auto variables to - anything stricter than their default alignment. - - The following C11 requirements are not supported here: - - - If A is zero, alignas has no effect. - - alignas can be used multiple times; the strictest one wins. - - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). - - */ - -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 -# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) -# define _Alignas(a) alignas (a) -# elif (!defined __attribute__ \ - && ((defined __APPLE__ && defined __MACH__ \ - ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (4 <= __clang_major__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ - || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) -# define _Alignas(a) __attribute__ ((__aligned__ (a))) -# elif 1300 <= _MSC_VER -# define _Alignas(a) __declspec (align (a)) -# endif -#endif -#if ((defined _Alignas \ - && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# define alignas _Alignas -#endif #if (defined alignas \ + || (defined __STDC_VERSION__ && 202311 <= __STDC_VERSION__) \ || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) # define __alignas_is_defined 1 #endif -/* Include if needed for offsetof. */ -#if _GL_STDALIGN_NEEDS_STDDEF -# include -#endif +#define __alignof_is_defined 1 #endif /* _GL_STDALIGN_H */ diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index b1438eeace..0bb9281f5e 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -5,9 +5,11 @@ 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 Written by Paul Eggert and Bruno Haible. + # Prepare for substituting if it is not supported. -AC_DEFUN([gl_STDALIGN_H], +AC_DEFUN([gl_ALIGNASOF], [ AC_CACHE_CHECK([for alignas and alignof], [gl_cv_header_working_stdalign_h], @@ -58,16 +60,11 @@ AC_DEFUN([gl_STDALIGN_H], test "$gl_cv_header_working_stdalign_h" != no && break done]) - GL_GENERATE_STDALIGN_H=false AS_CASE([$gl_cv_header_working_stdalign_h], - [no], - [GL_GENERATE_STDALIGN_H=true], [yes*keyword*], [AC_DEFINE([HAVE_C_ALIGNASOF], [1], [Define to 1 if the alignas and alignof keywords work.])]) - AC_CHECK_HEADERS_ONCE([stdalign.h]) - dnl The "zz" puts this toward config.h's end, to avoid potential dnl collisions with other definitions. AH_VERBATIM([zzalignas], @@ -75,11 +72,33 @@ AC_DEFUN([gl_STDALIGN_H], # if HAVE_STDALIGN_H # include # else - /* Substitute. Keep consistent with gnulib/lib/stdalign.in.h. */ -# ifndef _GL_STDALIGN_H -# define _GL_STDALIGN_H -# undef _Alignas -# undef _Alignof +/* ISO C23 alignas and alignof for platforms that lack it. + + References: + ISO C23 (latest free draft + ) + sections 6.5.3.4, 6.7.5, 7.15. + C++11 (latest free draft + ) + section 18.10. */ + +/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment + requirement of a structure member (i.e., slot or field) that is of + type TYPE, as an integer constant expression. + + This differs from GCC's and clang's __alignof__ operator, which can + yield a better-performing alignment for an object of that type. For + example, on x86 with GCC and on Linux/x86 with clang, + __alignof__ (double) and __alignof__ (long long) are 8, whereas + alignof (double) and alignof (long long) are 4 unless the option + '-malign-double' is used. + + The result cannot be used as a value for an 'enum' constant, if you + 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 + . + clang versions < 8.0.0 have the same bug. */ # if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ && !defined __clang__) \ @@ -100,35 +119,65 @@ AC_DEFUN([gl_STDALIGN_H], # if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)) # define alignof _Alignof # endif -# define __alignof_is_defined 1 -# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 -# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) -# define _Alignas(a) alignas (a) -# elif (!defined __attribute__ \ - && ((defined __APPLE__ && defined __MACH__ \ - ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (4 <= __clang_major__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ - || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) -# define _Alignas(a) __attribute__ ((__aligned__ (a))) -# elif 1300 <= _MSC_VER -# define _Alignas(a) __declspec (align (a)) -# endif -# endif -# if ((defined _Alignas \ - && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# define alignas _Alignas -# endif -# if (defined alignas \ - || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) -# define __alignas_is_defined 1 -# endif -# if _GL_STDALIGN_NEEDS_STDDEF -# include + +/* alignas (A), also known as _Alignas (A), aligns a variable or type + to the alignment A, where A is an integer constant expression. For + example: + + int alignas (8) foo; + struct s { int a; int alignas (8) bar; }; + + aligns the address of FOO and the offset of BAR to be multiples of 8. + + A should be a power of two that is at least the type's alignment + and at most the implementation's alignment limit. This limit is + 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable + to MSVC through at least version 10.0, A should be an integer + constant, as MSVC does not support expressions such as 1 << 3. + To be portable to Sun C 5.11, do not align auto variables to + anything stricter than their default alignment. + + The following C23 requirements are not supported here: + + - If A is zero, alignas has no effect. + - alignas can be used multiple times; the strictest one wins. + - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). + + */ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) +# define _Alignas(a) alignas (a) +# elif (!defined __attribute__ \ + && ((defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) +# define _Alignas(a) __attribute__ ((__aligned__ (a))) +# elif 1300 <= _MSC_VER +# define _Alignas(a) __declspec (align (a)) # endif -# endif /* _GL_STDALIGN_H */ +# endif +# if ((defined _Alignas \ + && !(defined __cplusplus \ + && (201103 <= __cplusplus || defined _MSC_VER))) \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) +# define alignas _Alignas +# endif +# if _GL_STDALIGN_NEEDS_STDDEF +# include +# endif # endif #endif]) ]) + +AC_DEFUN([gl_STDALIGN_H], +[ + AC_REQUIRE([gl_ALIGNASOF]) + GL_GENERATE_STDALIGN_H=false + AS_IF([test "$gl_cv_header_working_stdalign_h" = no], + [GL_GENERATE_STDALIGN_H=true]) + + AC_CHECK_HEADERS_ONCE([stdalign.h]) +]) diff --git a/modules/alignalloc b/modules/alignalloc index 0a34b4bcf4..400ab29182 100644 --- a/modules/alignalloc +++ b/modules/alignalloc @@ -7,12 +7,12 @@ lib/alignalloc.c m4/alignalloc.m4 Depends-on: +alignasof assert-h extensions extern-inline idx posix_memalign -stdalign stdckdint stdint diff --git a/modules/alignasof b/modules/alignasof new file mode 100644 index 0000000000..c5795a02d3 --- /dev/null +++ b/modules/alignasof @@ -0,0 +1,18 @@ +Description: +alignas and alignof that are like C23 and C++11. + +Files: +m4/stdalign.m4 + +configure.ac: +gl_ALIGNASOF + +Makefile.am: + +Include: + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/alignasof-tests b/modules/alignasof-tests new file mode 100644 index 0000000000..95602c2fef --- /dev/null +++ b/modules/alignasof-tests @@ -0,0 +1,13 @@ +Files: +tests/test-stdalign.c +tests/macros.h + +Depends-on: +assert-h +stdint + +configure.ac: + +Makefile.am: +TESTS += test-stdalign +check_PROGRAMS += test-stdalign diff --git a/modules/alignof b/modules/alignof index c78ab4a3c5..cc1ab96903 100644 --- a/modules/alignof +++ b/modules/alignof @@ -5,7 +5,7 @@ Files: lib/alignof.h Depends-on: -stdalign +alignasof configure.ac: diff --git a/modules/argp b/modules/argp index 74519a4b86..88cc78c3cb 100644 --- a/modules/argp +++ b/modules/argp @@ -18,6 +18,7 @@ lib/argp-xinl.c m4/argp.m4 Depends-on: +alignasof alloca basename-lgpl extern-inline @@ -31,7 +32,6 @@ strcase extensions vsnprintf sleep -stdalign stdbool stdio strerror diff --git a/modules/crypto/md4-buffer b/modules/crypto/md4-buffer index f5a5f160ed..73f11e35ee 100644 --- a/modules/crypto/md4-buffer +++ b/modules/crypto/md4-buffer @@ -7,8 +7,8 @@ lib/md4.c m4/md4.m4 Depends-on: +alignasof byteswap -stdalign stdint configure.ac: diff --git a/modules/crypto/md5-buffer b/modules/crypto/md5-buffer index cd51cab2de..8290130b48 100644 --- a/modules/crypto/md5-buffer +++ b/modules/crypto/md5-buffer @@ -9,10 +9,10 @@ m4/gl-openssl.m4 m4/md5.m4 Depends-on: +alignasof byteswap c99 extern-inline -stdalign stdint configure.ac: diff --git a/modules/crypto/sha1-buffer b/modules/crypto/sha1-buffer index a934d4e06b..ca6f477a66 100644 --- a/modules/crypto/sha1-buffer +++ b/modules/crypto/sha1-buffer @@ -9,10 +9,10 @@ m4/gl-openssl.m4 m4/sha1.m4 Depends-on: +alignasof byteswap c99 extern-inline -stdalign stdint configure.ac: diff --git a/modules/crypto/sha256-buffer b/modules/crypto/sha256-buffer index 85529a342e..9e5c029af4 100644 --- a/modules/crypto/sha256-buffer +++ b/modules/crypto/sha256-buffer @@ -9,10 +9,10 @@ m4/gl-openssl.m4 m4/sha256.m4 Depends-on: +alignasof byteswap c99 extern-inline -stdalign stdint configure.ac: diff --git a/modules/crypto/sha512-buffer b/modules/crypto/sha512-buffer index 416a0b5202..2a35e2ef20 100644 --- a/modules/crypto/sha512-buffer +++ b/modules/crypto/sha512-buffer @@ -9,10 +9,10 @@ m4/gl-openssl.m4 m4/sha512.m4 Depends-on: +alignasof byteswap c99 extern-inline -stdalign stdint u64 diff --git a/modules/crypto/sm3-buffer b/modules/crypto/sm3-buffer index 3df7d88259..5f2f2f6242 100644 --- a/modules/crypto/sm3-buffer +++ b/modules/crypto/sm3-buffer @@ -7,10 +7,10 @@ lib/sm3.c m4/sm3.m4 Depends-on: +alignasof byteswap c99 extern-inline -stdalign stdint configure.ac: diff --git a/modules/fts b/modules/fts index e5443adb2f..18b10fac6e 100644 --- a/modules/fts +++ b/modules/fts @@ -8,6 +8,7 @@ lib/fts-cycle.c m4/fts.m4 Depends-on: +alignasof attribute c99 closedir @@ -28,7 +29,6 @@ openat-h opendir opendirat readdir -stdalign stdbool stddef diff --git a/modules/rawmemchr b/modules/rawmemchr index 03da3a27b7..5f3eeaf2d0 100644 --- a/modules/rawmemchr +++ b/modules/rawmemchr @@ -7,9 +7,9 @@ lib/rawmemchr.valgrind m4/rawmemchr.m4 Depends-on: +alignasof assert-h extensions -stdalign stdint string diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper index 052499c1ad..c885ce2759 100644 --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -50,6 +50,7 @@ m4/relocatable-lib.m4 m4/setenv.m4 Depends-on: +alignasof assert-h c99 double-slash-root @@ -64,7 +65,6 @@ largefile libc-config pathmax ssize_t -stdalign stdbool stddef stdckdint diff --git a/modules/stdalign b/modules/stdalign index af038180fa..c5c29d3088 100644 --- a/modules/stdalign +++ b/modules/stdalign @@ -1,11 +1,16 @@ Description: alignas and alignof that are like C23 and C++11. +Notice: +The stdalign module is deprecated. +New code should use the alignasof module, and not include . + Files: lib/stdalign.in.h m4/stdalign.m4 Depends-on: +alignasof gen-header configure.ac: @@ -35,4 +40,4 @@ License: LGPLv2+ Maintainer: -Paul Eggert +all diff --git a/modules/stdalign-tests b/modules/stdalign-tests index e4665ed5fc..2a0d486d77 100644 --- a/modules/stdalign-tests +++ b/modules/stdalign-tests @@ -1,14 +1,9 @@ Files: -tests/test-stdalign.c -tests/macros.h Depends-on: -assert-h -stdint +alignasof-tests stdalign-c++-tests configure.ac: Makefile.am: -TESTS += test-stdalign -check_PROGRAMS += test-stdalign diff --git a/modules/stddef-tests b/modules/stddef-tests index 644eb0d7aa..f81ca4785e 100644 --- a/modules/stddef-tests +++ b/modules/stddef-tests @@ -2,8 +2,8 @@ Files: tests/test-stddef.c Depends-on: +alignasof assert-h -stdalign stddef-c++-tests configure.ac: diff --git a/modules/sys_socket b/modules/sys_socket index 44b2792669..ebb5d7d4a6 100644 --- a/modules/sys_socket +++ b/modules/sys_socket @@ -8,6 +8,7 @@ m4/sys_socket_h.m4 m4/sockpfaf.m4 Depends-on: +alignasf errno extern-inline gen-header @@ -17,7 +18,6 @@ snippet/c++defs snippet/warn-on-use socklen ssize_t -stdalign sys_uio configure.ac: -- 2.37.2