aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild-aux/config.guess9
-rwxr-xr-xbuild-aux/config.sub4
-rwxr-xr-xbuild-aux/gitlog-to-changelog4
-rwxr-xr-xbuild-aux/update-copyright4
-rw-r--r--doc/misc/texinfo.tex45
-rw-r--r--lib/attribute.h58
-rw-r--r--lib/explicit_bzero.c18
-rw-r--r--lib/gnulib.mk.in10
-rw-r--r--lib/ieee754.in.h4
-rw-r--r--lib/nstrftime.c9
-rw-r--r--m4/explicit_bzero.m41
-rw-r--r--m4/gnulib-common.m4229
-rw-r--r--m4/gnulib-comp.m42
13 files changed, 326 insertions, 71 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 45001cfecde..11fda528bc7 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
2# Attempt to guess a canonical system name. 2# Attempt to guess a canonical system name.
3# Copyright 1992-2020 Free Software Foundation, Inc. 3# Copyright 1992-2020 Free Software Foundation, Inc.
4 4
5timestamp='2020-01-01' 5timestamp='2020-04-26'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -1629,6 +1629,12 @@ copies of config.guess and config.sub with the latest versions from:
1629 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess 1629 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1630and 1630and
1631 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub 1631 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1632EOF
1633
1634year=`echo $timestamp | sed 's,-.*,,'`
1635# shellcheck disable=SC2003
1636if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
1637 cat >&2 <<EOF
1632 1638
1633If $0 has already been updated, send the following data and any 1639If $0 has already been updated, send the following data and any
1634information you think might be pertinent to config-patches@gnu.org to 1640information you think might be pertinent to config-patches@gnu.org to
@@ -1656,6 +1662,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
1656UNAME_SYSTEM = "$UNAME_SYSTEM" 1662UNAME_SYSTEM = "$UNAME_SYSTEM"
1657UNAME_VERSION = "$UNAME_VERSION" 1663UNAME_VERSION = "$UNAME_VERSION"
1658EOF 1664EOF
1665fi
1659 1666
1660exit 1 1667exit 1
1661 1668
diff --git a/build-aux/config.sub b/build-aux/config.sub
index f02d43ad500..a0d12275ac5 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,7 +2,7 @@
2# Configuration validation subroutine script. 2# Configuration validation subroutine script.
3# Copyright 1992-2020 Free Software Foundation, Inc. 3# Copyright 1992-2020 Free Software Foundation, Inc.
4 4
5timestamp='2020-01-01' 5timestamp='2020-04-24'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -1366,7 +1366,7 @@ case $os in
1366 | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 1366 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1367 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 1367 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1368 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 1368 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1369 | nsk* | powerunix) 1369 | nsk* | powerunix*)
1370 # Remember, each alternative MUST END IN *, to match a version number. 1370 # Remember, each alternative MUST END IN *, to match a version number.
1371 ;; 1371 ;;
1372 qnx*) 1372 qnx*)
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 511276757f5..be8082e7ffd 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -31,11 +31,11 @@
31# are valid code in both sh and perl. When executed by sh, they re-execute 31# are valid code in both sh and perl. When executed by sh, they re-execute
32# the script through the perl program found in $PATH. The '-x' option 32# the script through the perl program found in $PATH. The '-x' option
33# is essential as well; without it, perl would re-execute the script 33# is essential as well; without it, perl would re-execute the script
34# through /bin/sh. When executed by perl, the next two lines are a no-op. 34# through /bin/sh. When executed by perl, the next two lines are a no-op.
35eval 'exec perl -wSx "$0" "$@"' 35eval 'exec perl -wSx "$0" "$@"'
36 if 0; 36 if 0;
37 37
38my $VERSION = '2018-03-07 03:47'; # UTC 38my $VERSION = '2020-04-04 15:07'; # UTC
39# The definition above must lie within the first 8 lines in order 39# The definition above must lie within the first 8 lines in order
40# for the Emacs time-stamp write hook (at end) to update it. 40# for the Emacs time-stamp write hook (at end) to update it.
41# If you change this file with Emacs, please let the write hook 41# If you change this file with Emacs, please let the write hook
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index 4f79b56be78..d9b7f683a08 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -133,11 +133,11 @@
133# are valid code in both sh and perl. When executed by sh, they re-execute 133# are valid code in both sh and perl. When executed by sh, they re-execute
134# the script through the perl program found in $PATH. The '-x' option 134# the script through the perl program found in $PATH. The '-x' option
135# is essential as well; without it, perl would re-execute the script 135# is essential as well; without it, perl would re-execute the script
136# through /bin/sh. When executed by perl, the next two lines are a no-op. 136# through /bin/sh. When executed by perl, the next two lines are a no-op.
137eval 'exec perl -wSx -0777 -pi "$0" "$@"' 137eval 'exec perl -wSx -0777 -pi "$0" "$@"'
138 if 0; 138 if 0;
139 139
140my $VERSION = '2018-03-07.03:47'; # UTC 140my $VERSION = '2020-04-04.15:07'; # UTC
141# The definition above must lie within the first 8 lines in order 141# The definition above must lie within the first 8 lines in order
142# for the Emacs time-stamp write hook (at end) to update it. 142# for the Emacs time-stamp write hook (at end) to update it.
143# If you change this file with Emacs, please let the write hook 143# If you change this file with Emacs, please let the write hook
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index deca5991870..427494cbbfc 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2020-02-11.09} 6\def\texinfoversion{2020-05-02.00}
7% 7%
8% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. 8% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
9% 9%
@@ -349,34 +349,19 @@
349 \ifodd\pageno \advance\hoffset by \bindingoffset 349 \ifodd\pageno \advance\hoffset by \bindingoffset
350 \else \advance\hoffset by -\bindingoffset\fi 350 \else \advance\hoffset by -\bindingoffset\fi
351 % 351 %
352 \checkchapterpage
353 %
352 % Retrieve the information for the headings from the marks in the page, 354 % Retrieve the information for the headings from the marks in the page,
353 % and call Plain TeX's \makeheadline and \makefootline, which use the 355 % and call Plain TeX's \makeheadline and \makefootline, which use the
354 % values in \headline and \footline. 356 % values in \headline and \footline.
355 % 357 %
356 % This is used to check if we are on the first page of a chapter.
357 \ifcase1\the\savedtopmark\fi
358 \let\prevchaptername\thischaptername
359 \ifcase0\firstmark\fi
360 \let\curchaptername\thischaptername
361 %
362 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
363 %
364 \ifx\curchaptername\prevchaptername
365 \let\thischapterheading\thischapter
366 \else
367 % \thischapterheading is the same as \thischapter except it is blank
368 % for the first page of a chapter. This is to prevent the chapter name
369 % being shown twice.
370 \def\thischapterheading{}%
371 \fi
372 %
373 % Common context changes for both heading and footing. 358 % Common context changes for both heading and footing.
374 % Do this outside of the \shipout so @code etc. will be expanded in 359 % Do this outside of the \shipout so @code etc. will be expanded in
375 % the headline as they should be, not taken literally (outputting ''code). 360 % the headline as they should be, not taken literally (outputting ''code).
376 \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} 361 \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
377 % 362 %
363 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
378 \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% 364 \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
379 %
380 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi 365 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
381 \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% 366 \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
382 % 367 %
@@ -423,6 +408,24 @@
423\ifr@ggedbottom \kern-\dimen@ \vfil \fi} 408\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
424} 409}
425 410
411% Check if we are on the first page of a chapter.
412\def\checkchapterpage{%
413 % Get the chapter that was current at the end of the last page
414 \ifcase1\the\savedtopmark\fi
415 \let\prevchaptername\thischaptername
416 %
417 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
418 \let\curchaptername\thischaptername
419 %
420 \ifx\curchaptername\prevchaptername
421 \let\thischapterheading\thischapter
422 \else
423 % \thischapterheading is the same as \thischapter except it is blank
424 % for the first page of a chapter. This is to prevent the chapter name
425 % being shown twice.
426 \def\thischapterheading{}%
427 \fi
428}
426 429
427% Argument parsing 430% Argument parsing
428 431
@@ -3101,10 +3104,10 @@ end
3101 3104
3102% Allow a ragged right output to aid breaking long URL's. There can 3105% Allow a ragged right output to aid breaking long URL's. There can
3103% be a break at the \allowbreak with no extra glue (if the existing stretch in 3106% be a break at the \allowbreak with no extra glue (if the existing stretch in
3104% the line is sufficent), a break at the \penalty100 with extra glue added 3107% the line is sufficient), a break at the \penalty100 with extra glue added
3105% at the end of the line, or no break at all here. 3108% at the end of the line, or no break at all here.
3106% Changing the value of the penalty and/or the amount of stretch affects how 3109% Changing the value of the penalty and/or the amount of stretch affects how
3107% preferrable one choice is over the other. 3110% preferable one choice is over the other.
3108\def\urefallowbreak{% 3111\def\urefallowbreak{%
3109 \allowbreak 3112 \allowbreak
3110 \hskip 0pt plus 2 em\relax 3113 \hskip 0pt plus 2 em\relax
diff --git a/lib/attribute.h b/lib/attribute.h
new file mode 100644
index 00000000000..8ef9a399ade
--- /dev/null
+++ b/lib/attribute.h
@@ -0,0 +1,58 @@
1/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
2
3 Copyright 2020 Free Software Foundation, Inc.
4
5 This program is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17
18/* Written by Paul Eggert. */
19
20/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
21 macros used within Gnulib. */
22
23#ifndef _GL_ATTRIBUTE_H
24#define _GL_ATTRIBUTE_H
25
26/* C2X standard attributes have macro names that do not begin with
27 'ATTRIBUTE_'. */
28#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
29#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
30#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
31#define NODISCARD _GL_ATTRIBUTE_NODISCARD
32
33/* Selected GCC attributes; see:
34 https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
35 These names begin with 'ATTRIBUTE_' to avoid name clashes. */
36#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE(args)
37#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
38#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
39#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
40#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
41#define ATTRIBUTE_DEPRECATED _GL_ATTRIBUTE_DEPRECATED
42#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR(msg)
43#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
44#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT(spec)
45#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
46#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
47#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
48#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
49#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL(args)
50#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
51#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
52#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
53#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
54#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
55#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL(pos)
56#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING(msg)
57
58#endif /* _GL_ATTRIBUTE_H */
diff --git a/lib/explicit_bzero.c b/lib/explicit_bzero.c
index c82771fb1e3..b1f5acb7771 100644
--- a/lib/explicit_bzero.c
+++ b/lib/explicit_bzero.c
@@ -25,8 +25,18 @@
25# include <config.h> 25# include <config.h>
26#endif 26#endif
27 27
28/* memset_s need this define */
29#if HAVE_MEMSET_S
30# define __STDC_WANT_LIB_EXT1__ 1
31#endif
32
28#include <string.h> 33#include <string.h>
29 34
35#if defined _WIN32 && !defined __CYGWIN__
36# define WIN32_LEAN_AND_MEAN
37# include <windows.h>
38#endif
39
30#if _LIBC 40#if _LIBC
31/* glibc-internal users use __explicit_bzero_chk, and explicit_bzero 41/* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
32 redirects to that. */ 42 redirects to that. */
@@ -38,8 +48,12 @@
38void 48void
39explicit_bzero (void *s, size_t len) 49explicit_bzero (void *s, size_t len)
40{ 50{
41#ifdef HAVE_EXPLICIT_MEMSET 51#if defined _WIN32 && !defined __CYGWIN__
42 explicit_memset (s, 0, len); 52 (void) SecureZeroMemory (s, len);
53#elif HAVE_EXPLICIT_MEMSET
54 explicit_memset (s, '\0', len);
55#elif HAVE_MEMSET_S
56 (void) memset_s (s, len, '\0', len);
43#else 57#else
44 memset (s, '\0', len); 58 memset (s, '\0', len);
45# if defined __GNUC__ && !defined __clang__ 59# if defined __GNUC__ && !defined __clang__
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 0c7c2fb2b66..5c11dfc95ca 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -1122,6 +1122,7 @@ pdfdir = @pdfdir@
1122prefix = @prefix@ 1122prefix = @prefix@
1123program_transform_name = @program_transform_name@ 1123program_transform_name = @program_transform_name@
1124psdir = @psdir@ 1124psdir = @psdir@
1125runstatedir = @runstatedir@
1125sbindir = @sbindir@ 1126sbindir = @sbindir@
1126sharedstatedir = @sharedstatedir@ 1127sharedstatedir = @sharedstatedir@
1127srcdir = @srcdir@ 1128srcdir = @srcdir@
@@ -1208,6 +1209,15 @@ endif
1208endif 1209endif
1209## end gnulib module at-internal 1210## end gnulib module at-internal
1210 1211
1212## begin gnulib module attribute
1213ifeq (,$(OMIT_GNULIB_MODULE_attribute))
1214
1215
1216EXTRA_DIST += attribute.h
1217
1218endif
1219## end gnulib module attribute
1220
1211## begin gnulib module binary-io 1221## begin gnulib module binary-io
1212ifeq (,$(OMIT_GNULIB_MODULE_binary-io)) 1222ifeq (,$(OMIT_GNULIB_MODULE_binary-io))
1213 1223
diff --git a/lib/ieee754.in.h b/lib/ieee754.in.h
index 01ca648905f..d64bb46e9de 100644
--- a/lib/ieee754.in.h
+++ b/lib/ieee754.in.h
@@ -67,7 +67,7 @@ union ieee754_float
67#endif /* Little endian. */ 67#endif /* Little endian. */
68 } ieee; 68 } ieee;
69 69
70 /* This format makes it easier to see if a NaN is a signaling NaN. */ 70 /* This format makes it easier to see if a NaN is a signalling NaN. */
71 struct 71 struct
72 { 72 {
73#if __BYTE_ORDER == __BIG_ENDIAN 73#if __BYTE_ORDER == __BIG_ENDIAN
@@ -118,7 +118,7 @@ union ieee754_double
118#endif /* Little endian. */ 118#endif /* Little endian. */
119 } ieee; 119 } ieee;
120 120
121 /* This format makes it easier to see if a NaN is a signaling NaN. */ 121 /* This format makes it easier to see if a NaN is a signalling NaN. */
122 struct 122 struct
123 { 123 {
124#if __BYTE_ORDER == __BIG_ENDIAN 124#if __BYTE_ORDER == __BIG_ENDIAN
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index fc5052a549c..28b539dc2f2 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -68,16 +68,9 @@ extern char *tzname[];
68#include <string.h> 68#include <string.h>
69#include <stdbool.h> 69#include <stdbool.h>
70 70
71#include "attribute.h"
71#include <intprops.h> 72#include <intprops.h>
72 73
73#ifndef FALLTHROUGH
74# if __GNUC__ < 7
75# define FALLTHROUGH ((void) 0)
76# else
77# define FALLTHROUGH __attribute__ ((__fallthrough__))
78# endif
79#endif
80
81#ifdef COMPILE_WIDE 74#ifdef COMPILE_WIDE
82# include <endian.h> 75# include <endian.h>
83# define CHAR_T wchar_t 76# define CHAR_T wchar_t
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