aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert2020-05-03 14:57:10 -0700
committerPaul Eggert2020-05-03 15:10:07 -0700
commit6bd47f4477904a55fc08345394bfab9cd7eae2eb (patch)
tree12c98d95f3e66d85164bcf3adbc8f8db1c391939 /m4
parent40149b871889461713dc73634498f9d2150b0249 (diff)
downloademacs-6bd47f4477904a55fc08345394bfab9cd7eae2eb.tar.gz
emacs-6bd47f4477904a55fc08345394bfab9cd7eae2eb.zip
Update from Gnulib
This incorporates: 2020-05-03 attribute: new module 2020-04-13 explicit_bzero: improve code style 2020-04-13 explicit_bzero: On native Windows, use SecureZeroMemory 2020-04-13 explicit_bzero: use memset_s() when available 2020-04-04 maint: remove a stray inter-word space * build-aux/config.guess, build-aux/config.sub: * build-aux/gitlog-to-changelog, build-aux/update-copyright: * doc/misc/texinfo.tex, lib/explicit_bzero.c, lib/ieee754.in.h: * lib/nstrftime.c, m4/explicit_bzero.m4, m4/gnulib-common.m4: Copy from Gnulib. * lib/attribute.h: New file, copied from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'm4')
-rw-r--r--m4/explicit_bzero.m41
-rw-r--r--m4/gnulib-common.m4229
-rw-r--r--m4/gnulib-comp.m42
3 files changed, 201 insertions, 31 deletions
diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4
index 507816affdb..a415e7b4f5e 100644
--- a/m4/explicit_bzero.m4
+++ b/m4/explicit_bzero.m4
@@ -19,4 +19,5 @@ AC_DEFUN([gl_FUNC_EXPLICIT_BZERO],
19AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO], 19AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO],
20[ 20[
21 AC_CHECK_FUNCS([explicit_memset]) 21 AC_CHECK_FUNCS([explicit_memset])
22 AC_CHECK_FUNCS_ONCE([memset_s])
22]) 23])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index b4795c18aeb..b0010d0e351 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 48 1# gnulib-common.m4 serial 49
2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,15 @@ AC_DEFUN([gl_COMMON], [
15 AC_REQUIRE([gl_ZZGNULIB]) 15 AC_REQUIRE([gl_ZZGNULIB])
16]) 16])
17AC_DEFUN([gl_COMMON_BODY], [ 17AC_DEFUN([gl_COMMON_BODY], [
18 AH_VERBATIM([_GL_GNUC_PREREQ],
19[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
20#if defined __GNUC__ && defined __GNUC_MINOR__
21# define _GL_GNUC_PREREQ(major, minor) \
22 ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
23#else
24# define _GL_GNUC_PREREQ(major, minor) 0
25#endif
26])
18 AH_VERBATIM([_Noreturn], 27 AH_VERBATIM([_Noreturn],
19[/* The _Noreturn keyword of C11. */ 28[/* The _Noreturn keyword of C11. */
20#ifndef _Noreturn 29#ifndef _Noreturn
@@ -31,12 +40,12 @@ AC_DEFUN([gl_COMMON_BODY], [
31# define _Noreturn [[noreturn]] 40# define _Noreturn [[noreturn]]
32# elif ((!defined __cplusplus || defined __clang__) \ 41# elif ((!defined __cplusplus || defined __clang__) \
33 && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ 42 && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
34 || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ 43 || _GL_GNUC_PREREQ (4, 7) \
35 || (defined __apple_build_version__ \ 44 || (defined __apple_build_version__ \
36 ? 6000000 <= __apple_build_version__ \ 45 ? 6000000 <= __apple_build_version__ \
37 : 3 < __clang_major__ + (5 <= __clang_minor__)))) 46 : 3 < __clang_major__ + (5 <= __clang_minor__))))
38 /* _Noreturn works as-is. */ 47 /* _Noreturn works as-is. */
39# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C 48# elif _GL_GNUC_PREREQ (2, 8) || 0x5110 <= __SUNPRO_C
40# define _Noreturn __attribute__ ((__noreturn__)) 49# define _Noreturn __attribute__ ((__noreturn__))
41# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) 50# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
42# define _Noreturn __declspec (noreturn) 51# define _Noreturn __declspec (noreturn)
@@ -55,48 +64,206 @@ AC_DEFUN([gl_COMMON_BODY], [
55#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ 64#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
56# define __GNUC_STDC_INLINE__ 1 65# define __GNUC_STDC_INLINE__ 1
57#endif]) 66#endif])
58 AH_VERBATIM([unused_parameter], 67 AH_VERBATIM([attribute],
59[/* Define as a marker that can be attached to declarations that might not 68[/* Attributes. */
60 be used. This helps to reduce warnings, such as from 69#ifdef __has_attribute
61 GCC -Wunused-parameter. */ 70# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
62#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
63# define _GL_UNUSED __attribute__ ((__unused__))
64#else 71#else
65# define _GL_UNUSED 72# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
73# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
74# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
75# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
76# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
77# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
78# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
79# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
80# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
81# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
82# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
83# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
84# ifdef _ICC
85# define _GL_ATTR_may_alias 0
86# else
87# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
88# endif
89# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
90# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
91# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
92# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
93# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
94# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
95# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
96# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
97# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
98# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
99# define _GL_ATTR_warn_unused_result_GL_GNUC_PREREQ (3, 4)
66#endif 100#endif
67/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name 101
68 is a misnomer outside of parameter lists. */ 102]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
69#define _UNUSED_PARAMETER_ _GL_UNUSED 103[
70 104#if _GL_HAS_ATTRIBUTE (alloc_size)
71/* gcc supports the "unused" attribute on possibly unused labels, and 105# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
72 g++ has since version 4.5. Note to support C++ as well as C,
73 _GL_UNUSED_LABEL should be used with a trailing ; */
74#if !defined __cplusplus || __GNUC__ > 4 \
75 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
76# define _GL_UNUSED_LABEL _GL_UNUSED
77#else 106#else
78# define _GL_UNUSED_LABEL 107# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
79#endif 108#endif
80 109
81/* The __pure__ attribute was added in gcc 2.96. */ 110#if _GL_HAS_ATTRIBUTE (always_inline)
82#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) 111# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
83# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
84#else 112#else
85# define _GL_ATTRIBUTE_PURE /* empty */ 113# define _GL_ATTRIBUTE_ALWAYS_INLINE
86#endif 114#endif
87 115
88/* The __const__ attribute was added in gcc 2.95. */ 116#if _GL_HAS_ATTRIBUTE (artificial)
89#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 117# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
118#else
119# define _GL_ATTRIBUTE_ARTIFICIAL
120#endif
121
122/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
123 <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
124#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
125# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
126#else
127# define _GL_ATTRIBUTE_COLD
128#endif
129
130#if _GL_HAS_ATTRIBUTE (const)
90# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) 131# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
91#else 132#else
92# define _GL_ATTRIBUTE_CONST /* empty */ 133# define _GL_ATTRIBUTE_CONST
93#endif 134#endif
94 135
95/* The __malloc__ attribute was added in gcc 3. */ 136#if 201710L < __STDC_VERSION__
96#if 3 <= __GNUC__ 137# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
138#elif _GL_HAS_ATTRIBUTE (deprecated)
139# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
140#else
141# define _GL_ATTRIBUTE_DEPRECATED
142#endif
143
144#if _GL_HAS_ATTRIBUTE (error)
145# define _GL_ATTRIBUTE_ERROR(msg) __attribute__((__error__ (msg)))
146# define _GL_ATTRIBUTE_WARNING(msg) __attribute__((__warning__ (msg)))
147#else
148# define _GL_ATTRIBUTE_ERROR(msg)
149# define _GL_ATTRIBUTE_WARNING(msg)
150#endif
151
152#if _GL_HAS_ATTRIBUTE (externally_visible)
153# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
154#else
155# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
156#endif
157
158/* FALLTHROUGH is special, because it always expands to something. */
159#if 201710L < __STDC_VERSION__
160# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
161#elif _GL_HAS_ATTRIBUTE (fallthrough)
162# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
163#else
164# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
165#endif
166
167#if _GL_HAS_ATTRIBUTE (format)
168# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
169#else
170# define _GL_ATTRIBUTE_FORMAT(spec)
171#endif
172
173#if _GL_HAS_ATTRIBUTE (leaf)
174# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
175#else
176# define _GL_ATTRIBUTE_LEAF
177#endif
178
179#if _GL_HAS_ATTRIBUTE (may_alias)
180# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
181#else
182# define _GL_ATTRIBUTE_MAY_ALIAS
183#endif
184
185#if 201710L < __STDC_VERSION__
186# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
187#elif _GL_HAS_ATTRIBUTE (unused)
188# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
189#else
190# define _GL_ATTRIBUTE_MAYBE_UNUSED
191#endif
192/* Earlier spellings of this macro. */
193#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
194#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
195
196#if _GL_HAS_ATTRIBUTE (malloc)
97# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) 197# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
98#else 198#else
99# define _GL_ATTRIBUTE_MALLOC /* empty */ 199# define _GL_ATTRIBUTE_MALLOC
200#endif
201
202#if 201710L < __STDC_VERSION__
203# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
204#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
205# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
206#else
207# define _GL_ATTRIBUTE_NODISCARD
208#endif
209
210#if _GL_HAS_ATTRIBUTE (noinline)
211# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
212#else
213# define _GL_ATTRIBUTE_NOINLINE
214#endif
215
216#if _GL_HAS_ATTRIBUTE (nonnull)
217# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
218#else
219# define _GL_ATTRIBUTE_NONNULL(args)
220#endif
221
222#if _GL_HAS_ATTRIBUTE (nonstring)
223# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
224#else
225# define _GL_ATTRIBUTE_NONSTRING
226#endif
227
228/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
229
230#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
231# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
232#else
233# define _GL_ATTRIBUTE_NOTHROW
234#endif
235
236#if _GL_HAS_ATTRIBUTE (packed)
237# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
238#else
239# define _GL_ATTRIBUTE_PACKED
240#endif
241
242#if _GL_HAS_ATTRIBUTE (pure)
243# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
244#else
245# define _GL_ATTRIBUTE_PURE
246#endif
247
248#if _GL_HAS_ATTRIBUTE (returns_nonnull)
249# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
250#else
251# define _GL_ATTRIBUTE_RETURNS_NONNULL
252#endif
253
254#if _GL_HAS_ATTRIBUTE (sentinel)
255# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
256#else
257# define _GL_ATTRIBUTE_SENTINEL(pos)
258#endif
259
260]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
261[
262/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */
263#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
264# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
265#else
266# define _GL_UNUSED_LABEL
100#endif 267#endif
101]) 268])
102 AH_VERBATIM([async_safe], 269 AH_VERBATIM([async_safe],
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index d5faa9a1950..37170247884 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -47,6 +47,7 @@ AC_DEFUN([gl_EARLY],
47 # Code from module alloca-opt: 47 # Code from module alloca-opt:
48 # Code from module allocator: 48 # Code from module allocator:
49 # Code from module at-internal: 49 # Code from module at-internal:
50 # Code from module attribute:
50 # Code from module binary-io: 51 # Code from module binary-io:
51 # Code from module builtin-expect: 52 # Code from module builtin-expect:
52 # Code from module byteswap: 53 # Code from module byteswap:
@@ -934,6 +935,7 @@ AC_DEFUN([gl_FILE_LIST], [
934 lib/allocator.h 935 lib/allocator.h
935 lib/arg-nonnull.h 936 lib/arg-nonnull.h
936 lib/at-func.c 937 lib/at-func.c
938 lib/attribute.h
937 lib/binary-io.c 939 lib/binary-io.c
938 lib/binary-io.h 940 lib/binary-io.h
939 lib/byteswap.in.h 941 lib/byteswap.in.h