aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-11-25 22:28:31 -0800
committerPaul Eggert2017-11-25 22:48:09 -0800
commit8be3aee2813f528b02bc913ca4d79e34e72b1754 (patch)
treeaf1e8e35cedfe601076eade046a1a12303b93e84
parent265cee553f9d59a989d92e28865f6cc6fc02dcc9 (diff)
downloademacs-8be3aee2813f528b02bc913ca4d79e34e72b1754.tar.gz
emacs-8be3aee2813f528b02bc913ca4d79e34e72b1754.zip
Merge from Gnulib
This incorporates: 2017-11-23 stat: work around Solaris bug with tv_nsec < 0 2017-11-12 maint: shorten https://lists.gnu.org/archive/html/... links * build-aux/config.sub, doc/misc/texinfo.tex, lib/allocator.h: * lib/fstatat.c, lib/intprops.h, lib/lstat.c, lib/signal.in.h: * lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h: * lib/timespec.h, m4/alloca.m4, m4/extern-inline.m4: * m4/faccessat.m4, m4/fstatat.m4, m4/gnulib-common.m4: * m4/lstat.m4, m4/std-gnu11.m4, m4/sys_types_h.m4: * m4/vararrays.m4: Copy from Gnulib.
-rwxr-xr-xbuild-aux/config.sub15
-rw-r--r--doc/misc/texinfo.tex49
-rw-r--r--lib/allocator.h2
-rw-r--r--lib/fstatat.c12
-rw-r--r--lib/intprops.h6
-rw-r--r--lib/lstat.c39
-rw-r--r--lib/signal.in.h2
-rw-r--r--lib/stat-time.h45
-rw-r--r--lib/stdio-impl.h4
-rw-r--r--lib/stdio.in.h2
-rw-r--r--lib/timespec.h2
-rw-r--r--m4/alloca.m42
-rw-r--r--m4/extern-inline.m46
-rw-r--r--m4/faccessat.m410
-rw-r--r--m4/fstatat.m421
-rw-r--r--m4/gnulib-common.m46
-rw-r--r--m4/lstat.m47
-rw-r--r--m4/std-gnu11.m44
-rw-r--r--m4/sys_types_h.m42
-rw-r--r--m4/vararrays.m42
20 files changed, 162 insertions, 76 deletions
diff --git a/build-aux/config.sub b/build-aux/config.sub
index fb579478695..00f68b8e5f3 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-2017 Free Software Foundation, Inc. 3# Copyright 1992-2017 Free Software Foundation, Inc.
4 4
5timestamp='2017-11-04' 5timestamp='2017-11-23'
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
@@ -1546,6 +1546,19 @@ case $os in
1546 -dicos*) 1546 -dicos*)
1547 os=-dicos 1547 os=-dicos
1548 ;; 1548 ;;
1549 -pikeos*)
1550 # Until real need of OS specific support for
1551 # particular features comes up, bare metal
1552 # configurations are quite functional.
1553 case $basic_machine in
1554 arm*)
1555 os=-eabi
1556 ;;
1557 *)
1558 os=-elf
1559 ;;
1560 esac
1561 ;;
1549 -nacl*) 1562 -nacl*)
1550 ;; 1563 ;;
1551 -ios) 1564 -ios)
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 022c3f5b370..e2bf51af8c0 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{2017-09-11.18} 6\def\texinfoversion{2017-11-17.06}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -5969,24 +5969,30 @@ end
5969 % Split the last of the double-column material. 5969 % Split the last of the double-column material.
5970 \savemarks 5970 \savemarks
5971 \balancecolumns 5971 \balancecolumns
5972 % 5972 }%
5973 \eject % call the \output just set
5974 \ifdim\pagetotal=0pt
5973 % Having called \balancecolumns once, we do not 5975 % Having called \balancecolumns once, we do not
5974 % want to call it again. Therefore, reset \output to its normal 5976 % want to call it again. Therefore, reset \output to its normal
5975 % definition right away. 5977 % definition right away.
5976 \global\output = {\onepageout{\pagecontents\PAGE}}% 5978 \global\output = {\onepageout{\pagecontents\PAGE}}%
5977 }% 5979 %
5978 \eject 5980 \endgroup % started in \begindoublecolumns
5979 \endgroup % started in \begindoublecolumns 5981 \restoremarks
5980 \restoremarks 5982 % Leave the double-column material on the current page, no automatic
5981 % Leave the double-column material on the current page, no automatic 5983 % page break.
5982 % page break. 5984 \box\balancedcolumns
5983 \box\balancedcolumns 5985 %
5984 % 5986 % \pagegoal was set to the doubled \vsize above, since we restarted
5985 % \pagegoal was set to the doubled \vsize above, since we restarted 5987 % the current page. We're now back to normal single-column
5986 % the current page. We're now back to normal single-column 5988 % typesetting, so reset \pagegoal to the normal \vsize.
5987 % typesetting, so reset \pagegoal to the normal \vsize. 5989 \global\vsize = \txipageheight %
5988 \global\vsize = \txipageheight % 5990 \pagegoal = \txipageheight %
5989 \pagegoal = \txipageheight % 5991 \else
5992 % We had some left-over material. This might happen when \doublecolumnout
5993 % is called in \balancecolumns. Try again.
5994 \expandafter\enddoublecolumns
5995 \fi
5990} 5996}
5991\newbox\balancedcolumns 5997\newbox\balancedcolumns
5992\setbox\balancedcolumns=\vbox{shouldnt see this}% 5998\setbox\balancedcolumns=\vbox{shouldnt see this}%
@@ -6001,6 +6007,7 @@ end
6001 \ifdim\dimen@<5\baselineskip 6007 \ifdim\dimen@<5\baselineskip
6002 % Don't split a short final column in two. 6008 % Don't split a short final column in two.
6003 \setbox2=\vbox{}% 6009 \setbox2=\vbox{}%
6010 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
6004 \else 6011 \else
6005 \divide\dimen@ by 2 % target to split to 6012 \divide\dimen@ by 2 % target to split to
6006 \dimen@ii = \dimen@ 6013 \dimen@ii = \dimen@
@@ -6016,15 +6023,15 @@ end
6016 \repeat 6023 \repeat
6017 }% 6024 }%
6018 % Now the left column is in box 1, and the right column in box 3. 6025 % Now the left column is in box 1, and the right column in box 3.
6026 %
6019 % Check whether the left column has come out higher than the page itself. 6027 % Check whether the left column has come out higher than the page itself.
6020 % (Note that we have doubled \vsize for the double columns, so 6028 % (Note that we have doubled \vsize for the double columns, so
6021 % the actual height of the page is 0.5\vsize). 6029 % the actual height of the page is 0.5\vsize).
6022 \ifdim2\ht1>\vsize 6030 \ifdim2\ht1>\vsize
6023 % Just split the last of the double column material roughly in half. 6031 % It appears that we have been called upon to balance too much material.
6024 \setbox2=\box0 6032 % Output some of it with \doublecolumnout, leaving the rest on the page.
6025 \setbox0 = \vsplit2 to \dimen@ii 6033 \setbox\PAGE=\box0
6026 \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}% 6034 \doublecolumnout
6027 \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}%
6028 \else 6035 \else
6029 % Compare the heights of the two columns. 6036 % Compare the heights of the two columns.
6030 \ifdim4\ht1>5\ht3 6037 \ifdim4\ht1>5\ht3
@@ -6037,10 +6044,10 @@ end
6037 \setbox2=\vbox to\ht1{\unvbox3\unskip}% 6044 \setbox2=\vbox to\ht1{\unvbox3\unskip}%
6038 \setbox0=\vbox to\ht1{\unvbox1\unskip}% 6045 \setbox0=\vbox to\ht1{\unvbox1\unskip}%
6039 \fi 6046 \fi
6047 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
6040 \fi 6048 \fi
6041 \fi 6049 \fi
6042 % 6050 %
6043 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
6044} 6051}
6045\catcode`\@ = \other 6052\catcode`\@ = \other
6046 6053
diff --git a/lib/allocator.h b/lib/allocator.h
index 8f79d7435c3..fc3d646aa54 100644
--- a/lib/allocator.h
+++ b/lib/allocator.h
@@ -29,7 +29,7 @@ struct allocator
29 /* Do not use GCC attributes such as __attribute__ ((malloc)) with 29 /* Do not use GCC attributes such as __attribute__ ((malloc)) with
30 the function types pointed at by these members, because these 30 the function types pointed at by these members, because these
31 attributes do not work with pointers to functions. See 31 attributes do not work with pointers to functions. See
32 <https://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */ 32 <https://lists.gnu.org/r/bug-gnulib/2011-04/msg00007.html>. */
33 33
34 /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE 34 /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE
35 should return NULL, though not necessarily set errno. When given 35 should return NULL, though not necessarily set errno. When given
diff --git a/lib/fstatat.c b/lib/fstatat.c
index 294861f51b1..237e68c5da7 100644
--- a/lib/fstatat.c
+++ b/lib/fstatat.c
@@ -41,6 +41,8 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
41 above. */ 41 above. */
42#include "sys/stat.h" 42#include "sys/stat.h"
43 43
44#include "stat-time.h"
45
44#include <errno.h> 46#include <errno.h>
45#include <fcntl.h> 47#include <fcntl.h>
46#include <string.h> 48#include <string.h>
@@ -51,6 +53,12 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
51# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0 53# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
52# endif 54# endif
53 55
56static int
57normal_fstatat (int fd, char const *file, struct stat *st, int flag)
58{
59 return stat_time_normalize (orig_fstatat (fd, file, st, flag), st);
60}
61
54/* fstatat should always follow symbolic links that end in /, but on 62/* fstatat should always follow symbolic links that end in /, but on
55 Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. 63 Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
56 Likewise, trailing slash on a non-directory should be an error. 64 Likewise, trailing slash on a non-directory should be an error.
@@ -63,7 +71,7 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
63int 71int
64rpl_fstatat (int fd, char const *file, struct stat *st, int flag) 72rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
65{ 73{
66 int result = orig_fstatat (fd, file, st, flag); 74 int result = normal_fstatat (fd, file, st, flag);
67 size_t len; 75 size_t len;
68 76
69 if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0) 77 if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0)
@@ -79,7 +87,7 @@ rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
79 errno = ENOTDIR; 87 errno = ENOTDIR;
80 return -1; 88 return -1;
81 } 89 }
82 result = orig_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW); 90 result = normal_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
83 } 91 }
84 /* Fix stat behavior. */ 92 /* Fix stat behavior. */
85 if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/') 93 if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
diff --git a/lib/intprops.h b/lib/intprops.h
index a34e81c7b5e..2df7b1f9f69 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -26,7 +26,7 @@
26#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) 26#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
27 27
28/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see 28/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
29 <https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */ 29 <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
30#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) 30#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
31 31
32/* The extra casts in the following macros work around compiler bugs, 32/* The extra casts in the following macros work around compiler bugs,
@@ -179,7 +179,7 @@
179/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. 179/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
180 See above for restrictions. Avoid && and || as they tickle 180 See above for restrictions. Avoid && and || as they tickle
181 bugs in Sun C 5.11 2010/08/13 and other compilers; see 181 bugs in Sun C 5.11 2010/08/13 and other compilers; see
182 <https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */ 182 <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */
183#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ 183#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
184 ((b) < 0 \ 184 ((b) < 0 \
185 ? ((a) < 0 \ 185 ? ((a) < 0 \
@@ -443,7 +443,7 @@
443 implementation-defined result or signal for values outside T's 443 implementation-defined result or signal for values outside T's
444 range. However, code that works around this theoretical problem 444 range. However, code that works around this theoretical problem
445 runs afoul of a compiler bug in Oracle Studio 12.3 x86. See: 445 runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
446 https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html 446 https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
447 As the compiler bug is real, don't try to work around the 447 As the compiler bug is real, don't try to work around the
448 theoretical problem. */ 448 theoretical problem. */
449 449
diff --git a/lib/lstat.c b/lib/lstat.c
index c721a4e641c..f3c61779540 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -47,6 +47,8 @@ orig_lstat (const char *filename, struct stat *buf)
47 above. */ 47 above. */
48# include "sys/stat.h" 48# include "sys/stat.h"
49 49
50# include "stat-time.h"
51
50# include <string.h> 52# include <string.h>
51# include <errno.h> 53# include <errno.h>
52 54
@@ -66,32 +68,33 @@ orig_lstat (const char *filename, struct stat *buf)
66int 68int
67rpl_lstat (const char *file, struct stat *sbuf) 69rpl_lstat (const char *file, struct stat *sbuf)
68{ 70{
69 size_t len; 71 int result = orig_lstat (file, sbuf);
70 int lstat_result = orig_lstat (file, sbuf);
71
72 if (lstat_result != 0)
73 return lstat_result;
74 72
75 /* This replacement file can blindly check against '/' rather than 73 /* This replacement file can blindly check against '/' rather than
76 using the ISSLASH macro, because all platforms with '\\' either 74 using the ISSLASH macro, because all platforms with '\\' either
77 lack symlinks (mingw) or have working lstat (cygwin) and thus do 75 lack symlinks (mingw) or have working lstat (cygwin) and thus do
78 not compile this file. 0 len should have already been filtered 76 not compile this file. 0 len should have already been filtered
79 out above, with a failure return of ENOENT. */ 77 out above, with a failure return of ENOENT. */
80 len = strlen (file); 78 if (result == 0)
81 if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode))
82 return 0;
83
84 /* At this point, a trailing slash is only permitted on
85 symlink-to-dir; but it should have found information on the
86 directory, not the symlink. Call stat() to get info about the
87 link's referent. Our replacement stat guarantees valid results,
88 even if the symlink is not pointing to a directory. */
89 if (!S_ISLNK (sbuf->st_mode))
90 { 79 {
91 errno = ENOTDIR; 80 if (S_ISDIR (sbuf->st_mode) || file[strlen (file) - 1] != '/')
92 return -1; 81 result = stat_time_normalize (result, sbuf);
82 else
83 {
84 /* At this point, a trailing slash is permitted only on
85 symlink-to-dir; but it should have found information on the
86 directory, not the symlink. Call 'stat' to get info about the
87 link's referent. Our replacement stat guarantees valid results,
88 even if the symlink is not pointing to a directory. */
89 if (!S_ISLNK (sbuf->st_mode))
90 {
91 errno = ENOTDIR;
92 return -1;
93 }
94 result = stat (file, sbuf);
95 }
93 } 96 }
94 return stat (file, sbuf); 97 return result;
95} 98}
96 99
97#endif /* HAVE_LSTAT */ 100#endif /* HAVE_LSTAT */
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 9c32b14962f..e8107c37bf5 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -200,7 +200,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
200/* When also using extern inline, suppress the use of static inline in 200/* When also using extern inline, suppress the use of static inline in
201 standard headers of problematic Apple configurations, as Libc at 201 standard headers of problematic Apple configurations, as Libc at
202 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., 202 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
203 <https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. 203 <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
204 Perhaps Apple will fix this some day. */ 204 Perhaps Apple will fix this some day. */
205#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ 205#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
206 && (defined __i386__ || defined __x86_64__)) 206 && (defined __i386__ || defined __x86_64__))
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 47a3bf8f21e..1cf821992ed 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -20,6 +20,10 @@
20#ifndef STAT_TIME_H 20#ifndef STAT_TIME_H
21#define STAT_TIME_H 1 21#define STAT_TIME_H 1
22 22
23#include "intprops.h"
24
25#include <errno.h>
26#include <stddef.h>
23#include <sys/stat.h> 27#include <sys/stat.h>
24#include <time.h> 28#include <time.h>
25 29
@@ -202,6 +206,47 @@ get_stat_birthtime (struct stat const *st)
202 return t; 206 return t;
203} 207}
204 208
209/* If a stat-like function returned RESULT, normalize the timestamps
210 in *ST, in case this platform suffers from the Solaris 11 bug where
211 tv_nsec might be negative. Return the adjusted RESULT, setting
212 errno to EOVERFLOW if normalization overflowed. This function
213 is intended to be private to this .h file. */
214_GL_STAT_TIME_INLINE int
215stat_time_normalize (int result, struct stat *st)
216{
217#if defined __sun && defined STAT_TIMESPEC
218 if (result == 0)
219 {
220 long int timespec_resolution = 1000000000;
221 short int const ts_off[] = { offsetof (struct stat, st_atim),
222 offsetof (struct stat, st_mtim),
223 offsetof (struct stat, st_ctim) };
224 int i;
225 for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
226 {
227 struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
228 long int q = ts->tv_nsec / timespec_resolution;
229 long int r = ts->tv_nsec % timespec_resolution;
230 if (r < 0)
231 {
232 r += timespec_resolution;
233 q--;
234 }
235 ts->tv_nsec = r;
236 /* Overflow is possible, as Solaris 11 stat can yield
237 tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
238 INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
239 if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
240 {
241 errno = EOVERFLOW;
242 return -1;
243 }
244 }
245 }
246#endif
247 return result;
248}
249
205#ifdef __cplusplus 250#ifdef __cplusplus
206} 251}
207#endif 252#endif
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 8960333687e..329801ad23b 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -81,7 +81,7 @@
81#ifdef __TANDEM /* NonStop Kernel */ 81#ifdef __TANDEM /* NonStop Kernel */
82# ifndef _IOERR 82# ifndef _IOERR
83/* These values were determined by the program 'stdioext-flags' at 83/* These values were determined by the program 'stdioext-flags' at
84 <https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */ 84 <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>. */
85# define _IOERR 0x40 85# define _IOERR 0x40
86# define _IOREAD 0x80 86# define _IOREAD 0x80
87# define _IOWRT 0x4 87# define _IOWRT 0x4
@@ -132,7 +132,7 @@ struct _gl_real_FILE
132# define fp_ ((struct _gl_real_FILE *) fp) 132# define fp_ ((struct _gl_real_FILE *) fp)
133 133
134/* These values were determined by a program similar to the one at 134/* These values were determined by a program similar to the one at
135 <https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */ 135 <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>. */
136# define _IOREAD 0x1 136# define _IOREAD 0x1
137# define _IOWRT 0x2 137# define _IOWRT 0x2
138# define _IORW 0x4 138# define _IORW 0x4
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 066e08eba9a..505f3f49f4e 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -152,7 +152,7 @@
152/* When also using extern inline, suppress the use of static inline in 152/* When also using extern inline, suppress the use of static inline in
153 standard headers of problematic Apple configurations, as Libc at 153 standard headers of problematic Apple configurations, as Libc at
154 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., 154 least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
155 <https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. 155 <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
156 Perhaps Apple will fix this some day. */ 156 Perhaps Apple will fix this some day. */
157#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ 157#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
158 && defined __GNUC__ && defined __STDC__) 158 && defined __GNUC__ && defined __STDC__)
diff --git a/lib/timespec.h b/lib/timespec.h
index cc34067374f..84c8146a3ea 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -87,7 +87,7 @@ timespec_cmp (struct timespec a, struct timespec b)
87 return 1; 87 return 1;
88 88
89 /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See: 89 /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See:
90 http://lists.gnu.org/archive/html/bug-gnulib/2017-10/msg00006.html */ 90 http://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html */
91 assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION); 91 assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
92 assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION); 92 assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
93 93
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index d1224316498..867954a2e37 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -44,7 +44,7 @@ AC_DEFUN([gl_FUNC_ALLOCA],
44AC_DEFUN([gl_PREREQ_ALLOCA], [:]) 44AC_DEFUN([gl_PREREQ_ALLOCA], [:])
45 45
46# This works around a bug in autoconf <= 2.68. 46# This works around a bug in autoconf <= 2.68.
47# See <https://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>. 47# See <https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html>.
48 48
49m4_version_prereq([2.69], [] ,[ 49m4_version_prereq([2.69], [] ,[
50 50
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index c08af18af68..207aa6a0895 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
11[/* Please see the Gnulib manual for how to use these macros. 11[/* Please see the Gnulib manual for how to use these macros.
12 12
13 Suppress extern inline with HP-UX cc, as it appears to be broken; see 13 Suppress extern inline with HP-UX cc, as it appears to be broken; see
14 <https://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. 14 <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
15 15
16 Suppress extern inline with Sun C in standards-conformance mode, as it 16 Suppress extern inline with Sun C in standards-conformance mode, as it
17 mishandles inline functions that call each other. E.g., for 'inline void f 17 mishandles inline functions that call each other. E.g., for 'inline void f
@@ -28,13 +28,13 @@ AC_DEFUN([gl_EXTERN_INLINE],
28 from calling static functions. This bug is known to occur on: 28 from calling static functions. This bug is known to occur on:
29 29
30 OS X 10.8 and earlier; see: 30 OS X 10.8 and earlier; see:
31 https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html 31 https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
32 32
33 DragonFly; see 33 DragonFly; see
34 http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log 34 http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
35 35
36 FreeBSD; see: 36 FreeBSD; see:
37 https://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html 37 https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
38 38
39 OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and 39 OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
40 for clang but remains for g++; see <https://trac.macports.org/ticket/41033>. 40 for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
diff --git a/m4/faccessat.m4 b/m4/faccessat.m4
index f4cb49d166c..c64545abd46 100644
--- a/m4/faccessat.m4
+++ b/m4/faccessat.m4
@@ -1,4 +1,4 @@
1# serial 7 1# serial 8
2# See if we need to provide faccessat replacement. 2# See if we need to provide faccessat replacement.
3 3
4dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. 4dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
@@ -11,6 +11,7 @@ dnl with or without modifications, as long as this notice is preserved.
11AC_DEFUN([gl_FUNC_FACCESSAT], 11AC_DEFUN([gl_FUNC_FACCESSAT],
12[ 12[
13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) 13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
14 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
14 15
15 dnl Persuade glibc <unistd.h> to declare faccessat(). 16 dnl Persuade glibc <unistd.h> to declare faccessat().
16 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 17 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -18,8 +19,11 @@ AC_DEFUN([gl_FUNC_FACCESSAT],
18 AC_CHECK_FUNCS_ONCE([faccessat]) 19 AC_CHECK_FUNCS_ONCE([faccessat])
19 if test $ac_cv_func_faccessat = no; then 20 if test $ac_cv_func_faccessat = no; then
20 HAVE_FACCESSAT=0 21 HAVE_FACCESSAT=0
21 elif test "$gl_cv_func_lstat_dereferences_slashed_symlink" != yes; then 22 else
22 REPLACE_FACCESSAT=1 23 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
24 *yes) ;;
25 *) REPLACE_FACCESSAT=1 ;;
26 esac
23 fi 27 fi
24]) 28])
25 29
diff --git a/m4/fstatat.m4 b/m4/fstatat.m4
index b29ec9258e9..767eb83db4b 100644
--- a/m4/fstatat.m4
+++ b/m4/fstatat.m4
@@ -1,4 +1,4 @@
1# fstatat.m4 serial 3 1# fstatat.m4 serial 4
2dnl Copyright (C) 2004-2017 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-2017 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,
@@ -13,14 +13,14 @@ AC_DEFUN([gl_FUNC_FSTATAT],
13 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) 13 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) 15 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
16 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 16 AC_REQUIRE([AC_CANONICAL_HOST])
17 AC_CHECK_FUNCS_ONCE([fstatat]) 17 AC_CHECK_FUNCS_ONCE([fstatat])
18 18
19 if test $ac_cv_func_fstatat = no; then 19 if test $ac_cv_func_fstatat = no; then
20 HAVE_FSTATAT=0 20 HAVE_FSTATAT=0
21 else 21 else
22 dnl Test for an AIX 7.1 bug; see 22 dnl Test for an AIX 7.1 bug; see
23 dnl <https://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. 23 dnl <https://lists.gnu.org/r/bug-tar/2011-09/msg00015.html>.
24 AC_CACHE_CHECK([whether fstatat (..., 0) works], 24 AC_CACHE_CHECK([whether fstatat (..., 0) works],
25 [gl_cv_func_fstatat_zero_flag], 25 [gl_cv_func_fstatat_zero_flag],
26 [AC_RUN_IFELSE( 26 [AC_RUN_IFELSE(
@@ -46,15 +46,20 @@ AC_DEFUN([gl_FUNC_FSTATAT],
46 46
47 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in 47 case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
48 *yes+*yes) ;; 48 *yes+*yes) ;;
49 *) REPLACE_FSTATAT=1 49 *) REPLACE_FSTATAT=1 ;;
50 case $gl_cv_func_fstatat_zero_flag in 50 esac
51 *yes) 51
52 case $host_os in
53 solaris*)
54 REPLACE_FSTATAT=1 ;;
55 esac
56
57 case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
58 1,*yes)
52 AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1], 59 AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1],
53 [Define to 1 if fstatat (..., 0) works. 60 [Define to 1 if fstatat (..., 0) works.
54 For example, it does not work in AIX 7.1.]) 61 For example, it does not work in AIX 7.1.])
55 ;; 62 ;;
56 esac
57 ;;
58 esac 63 esac
59 fi 64 fi
60]) 65])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 36da841287d..bea5a650e76 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -228,13 +228,13 @@ m4_ifndef([AS_VAR_IF],
228# This is like AC_PROG_CC_C99, except that 228# This is like AC_PROG_CC_C99, except that
229# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, 229# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
230# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC 230# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
231# <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>, 231# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
232# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 232# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
233# <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>. 233# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>.
234# Remaining problems: 234# Remaining problems:
235# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options 235# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
236# to CC twice 236# to CC twice
237# <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>. 237# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>.
238# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. 238# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
239AC_DEFUN([gl_PROG_CC_C99], 239AC_DEFUN([gl_PROG_CC_C99],
240[ 240[
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index 0b6e5d70cba..6ba18cec574 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
1# serial 29 1# serial 30
2 2
3# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc. 3# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc.
4# 4#
@@ -10,14 +10,15 @@ dnl From Jim Meyering.
10 10
11AC_DEFUN([gl_FUNC_LSTAT], 11AC_DEFUN([gl_FUNC_LSTAT],
12[ 12[
13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) 14 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
14 dnl If lstat does not exist, the replacement <sys/stat.h> does 15 dnl If lstat does not exist, the replacement <sys/stat.h> does
15 dnl "#define lstat stat", and lstat.c is a no-op. 16 dnl "#define lstat stat", and lstat.c is a no-op.
16 AC_CHECK_FUNCS_ONCE([lstat]) 17 AC_CHECK_FUNCS_ONCE([lstat])
17 if test $ac_cv_func_lstat = yes; then 18 if test $ac_cv_func_lstat = yes; then
18 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) 19 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
19 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in 20 case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
20 *no) 21 solaris* | *no)
21 REPLACE_LSTAT=1 22 REPLACE_LSTAT=1
22 ;; 23 ;;
23 esac 24 esac
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index 3c2f26f4666..c0466beb404 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -369,7 +369,7 @@ dnl just the module. Instead, define the (private) symbol
369dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>. 369dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>.
370dnl The resulting compiler passes the test case here, and that's 370dnl The resulting compiler passes the test case here, and that's
371dnl good enough. For more, please see the thread starting at: 371dnl good enough. For more, please see the thread starting at:
372dnl https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html 372dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html
373dnl Tru64 -c99 373dnl Tru64 -c99
374dnl with extended modes being tried first. 374dnl with extended modes being tried first.
375[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl 375[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl
@@ -458,7 +458,7 @@ dnl preferably extc11.
458# -------------- 458# --------------
459# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, 459# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC,
460# as that'd be incompatible with how Automake redefines AC_PROG_CC. See 460# as that'd be incompatible with how Automake redefines AC_PROG_CC. See
461# <https://lists.gnu.org/archive/html/autoconf/2012-10/msg00048.html>. 461# <https://lists.gnu.org/r/autoconf/2012-10/msg00048.html>.
462AU_DEFUN([AC_PROG_CC_C89], 462AU_DEFUN([AC_PROG_CC_C89],
463 [AC_REQUIRE([AC_PROG_CC])], 463 [AC_REQUIRE([AC_PROG_CC])],
464 [$0 is obsolete; use AC_PROG_CC] 464 [$0 is obsolete; use AC_PROG_CC]
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index de56d04fc15..75097713d98 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -35,7 +35,7 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
35]) 35])
36 36
37# This works around a buggy version in autoconf <= 2.69. 37# This works around a buggy version in autoconf <= 2.69.
38# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html> 38# See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
39 39
40m4_version_prereq([2.70], [], [ 40m4_version_prereq([2.70], [], [
41 41
diff --git a/m4/vararrays.m4 b/m4/vararrays.m4
index 38a3ed23542..2f678e381eb 100644
--- a/m4/vararrays.m4
+++ b/m4/vararrays.m4
@@ -27,7 +27,7 @@ AC_DEFUN([AC_C_VARARRAYS],
27 [[/* Test for VLA support. This test is partly inspired 27 [[/* Test for VLA support. This test is partly inspired
28 from examples in the C standard. Use at least two VLA 28 from examples in the C standard. Use at least two VLA
29 functions to detect the GCC 3.4.3 bug described in: 29 functions to detect the GCC 3.4.3 bug described in:
30 https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html 30 https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html
31 */ 31 */
32 #ifdef __STDC_NO_VLA__ 32 #ifdef __STDC_NO_VLA__
33 syntax error; 33 syntax error;