Bruno Haible [Sat, 17 Dec 2016 18:08:14 +0000 (19:08 +0100)]
acosf: Avoid redefinition error on MSVC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Define REPLACE_ACOSF.
* m4/acosf.m4 (gl_FUNC_ACOSF): Set REPLACE_ACOSF to 1 if the function
may be defined as an inline function.
* modules/math (Makefile.am): Substitute REPLACE_ACOSF.
* lib/math.in.h (acosf): Override if REPLACE_ACOSF is 1.
Bruno Haible [Sat, 17 Dec 2016 15:44:51 +0000 (16:44 +0100)]
Avoid redefinition errors on MSVC.
* m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if
the function may be defined as an inline function.
* m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if
the function may be defined as an inline function.
Bruno Haible [Sat, 17 Dec 2016 12:27:08 +0000 (13:27 +0100)]
fpending: Revert workaround against Emacs bug.
* lib/stdio-impl.h [__MINGW32__]: Revert conditional.
The Emacs bug is fixed by Eli Zaretskii in
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00715.html
Paul Eggert [Sat, 17 Dec 2016 02:20:21 +0000 (18:20 -0800)]
builtin-expect: improve port to IBM XL C
Problem reported for z/OS by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00079.html
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
Test for <builtins.h> directly.
Paul Eggert [Sat, 17 Dec 2016 00:47:26 +0000 (16:47 -0800)]
builtin-expect: port to IBM XL C
Problem reported for z/OS by Daniel Richard G. in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00074.html
* m4/builtin-expect.m4 (gl___BUILTIN_EXPECT):
Also allow __builtin_expect defined via a standard include file.
Paul Eggert [Fri, 16 Dec 2016 17:34:02 +0000 (09:34 -0800)]
regex: fix integer-overflow bug in never-used code
Problem reported by Clément Pit–Claudel in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00654.html
* lib/regex_internal.h: Include intprops.h.
* lib/regexec.c (re_search_2_stub): Use it to avoid undefined
behavior on integer overflow.
* modules/regex (Depends-on): Add intprops.
Paul Eggert [Fri, 16 Dec 2016 15:38:58 +0000 (07:38 -0800)]
fpending: fix port to MinGW on Emacs
* lib/stdio-impl.h [__MINGW32__]: Do not include errno.h.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html
Is Plan 9 still a valid porting target, anyway?
Paul Eggert [Thu, 15 Dec 2016 17:59:21 +0000 (09:59 -0800)]
xalloc: do not exceed PTRDIFF_MAX
* lib/xmalloc.c (xcalloc) [HAVE_GNU_CALLOC]: Do not omit
xalloc_oversized check, since objects larger than PTRDIFF_MAX
bytes have pointer-subtraction problems.
Paul Eggert [Thu, 15 Dec 2016 17:56:53 +0000 (09:56 -0800)]
malloca: do not exceed PTRDIFF_MAX
* lib/malloca.h: Include xalloc-oversized.
(nmalloca): Use xalloc_oversized instead of rolling our own.
* modules/malloca (Depends-on):
* modules/relocatable-prog-wrapper (Depends-on):
Add xalloc-oversized.
Paul Eggert [Thu, 15 Dec 2016 17:53:45 +0000 (09:53 -0800)]
quotearg: pacify GCC better
* modules/quotearg (Depends-on): Add minmax, stdint.
* lib/quotearg.c: Include minmax.h, stdint.h.
(nslots): Now int, as there seems little point to going to extra
work merely to support the INT_MAX slot, which nobody ever uses.
(quotearg_n_options): Redo size-overflow checks to pacify GCC
and to catch (mostly-theoretical) ptrdiff_t problems too.
This can be done via one comparison.
Paul Eggert [Thu, 15 Dec 2016 01:09:04 +0000 (17:09 -0800)]
xalloc-oversized: check for PTRDIFF_MAX too
This avoids undefined behavior when subtracting pointers to
objects containing more than PTRDIFF_MAX bytes.
* lib/xalloc-oversized.h (__xalloc_oversized, xalloc_oversized):
Also return 1 if the result would exceed PTRDIFF_MAX>
* modules/xalloc-oversized (Depends-on):
Add stdint.
Paul Eggert [Wed, 14 Dec 2016 21:21:04 +0000 (13:21 -0800)]
dfa: fix some unlikely integer overflows
I found these while reviewing the recent Coverity-related fix.
This patch changes part of dfa.c to prefer ptrdiff_t instead of
size_t for object counts. Using ptrdiff_t is the style typically
used in Emacs; although it wastes a sign bit as sizes can never be
negative, it makes -fsanitize=undefined more likely to catch
integer overflows in index calculation, and nowadays the upside is
typically more important than the downside. Although perhaps the
rest of dfa.c should be changed to prefer ptrdiff_t as well (much
of dfa.c already does, since it uses state_num which is signed),
that is a bigger change and is not needed to fix the bugs I found.
* lib/dfa.c: Include stdint.h and intprops.h.
(TOKEN_MAX): New macro.
(position_set, struct mb_char_classes, struct dfa, maybe_realloc)
(charclass_index, parse_bracket_exp, addtok, insert, merge)
(realloc_trans_if_necessary, free_mbdata):
Use ptrdiff_t instead of size_t for object counts related to xpalloc.
This is safe because xpalloc checks that the sizes do not exceed
either SIZE_MAX or PTRDIFF_MAX.
(xpalloc): New function, mostly taken from Emacs.
(maybe_realloc, copy, realloc_trans_if_necessary): Use it.
(maybe_realloc): Add NITEMS_MAX to signature. All callers changed.
(charclass_index): Check for integer overflow in computing
charclass index; it must not exceed TOKEN_MAX - CSET, as CSET is
added to it later.
(alloc_position_set): Check for integer overflow. On typical
platforms this check has zero overhead, since the constant
expression is false.
(realloc_trans_if_necessary):
Remove assertion, which I hope Coverity no longer needs.
* modules/dfa (Depends-on): Add intprops, stdint.
John W. Eaton [Tue, 13 Dec 2016 17:43:09 +0000 (12:43 -0500)]
link: fix test to declare use of rename()
The test in link.m4 needs to include <stdio.h> to provide a declaration
for the rename function. The test fails if building with GCC's
-Werror=implicit-function-declaration option.
This was reported as part of a bug with building Octave on Fedora, which
now uses -Werror=implicit-function-declaration by default.
Bruno Haible [Tue, 13 Dec 2016 10:19:35 +0000 (11:19 +0100)]
fpending: Port to native Windows with MSVC.
* lib/fpending.c: Include stdio-impl.h.
(__fpending): Include all known implementations. Err out if it's not
ported.
* m4/fpending.m4 (gl_PREREQ_FPENDING): Remove macro.
* modules/fpending (Files): Add lib/stdio-impl.h.
(configure.ac): Don't invoke gl_PREREQ_FPENDING.
Jim Meyering [Mon, 12 Dec 2016 06:39:42 +0000 (22:39 -0800)]
non-recursive-gnulib-prefix-hack.m4: remove leading "(" in case stmt
* m4/non-recursive-gnulib-prefix-hack.m4: That leading "(" happens
to work with most shells, but not with the one provided by many
Solaris 10 systems, so running configure with such a /bin/sh evokes
e.g., "./configure: syntax error at line 33602: `(' unexpected".
Reported by Assaf Gordon in
https://lists.gnu.org/archive/html/sed-devel/2016-12/msg00002.html
Bruno Haible [Sat, 10 Dec 2016 13:04:42 +0000 (14:04 +0100)]
threadlib: Optimize out runtime test on Solaris >= 10.
* m4/threadlib.m4 (gl_THREADLIB_BODY): Don't set
PTHREAD_IN_USE_DETECTION_HARD if configuring on Solaris 10 or newer.
Reported by Peter Felecan at <https://savannah.gnu.org/bugs/?32087>.
Paul Eggert [Fri, 9 Dec 2016 23:09:03 +0000 (15:09 -0800)]
dfa: fix performance bug that recomputes trans
* lib/dfa.c (build_state): Fix performance bug introduced in Nov
25 on-demand changes. The bug caused build_state to reset all
d->trans elements to -2 even when d->trans was already non-null.
Use C99 style decls after statements in this function.
Paul Eggert [Fri, 9 Dec 2016 16:16:13 +0000 (08:16 -0800)]
same-inode: port to MinGW
Here st_ino is always 0, so change the definition of SAME_INODE so
that 1 means the two files are the same, 0 with st_ino != 0 means
they differ, and 0 with st_ino == 0 means we don’t know. Problem
reported by Bruno Haible (Bug#25146).
* doc/posix-headers/sys_stat.texi (sys/stat.h): Update.
* lib/same-inode.h (SAME_INODE): Return 0 on MinGW.
gnulib-tool: properly list the LGPL3orGPLv2 license
* gnulib-tool (func_import): Adhere to the license guideline when
rewriting the license text to "LGPLv3+ or GPLv2":
https://www.gnu.org/prep/maintain/maintain.html#Licensing-of-GNU-Packages
KO Myung-Hun [Thu, 1 Dec 2016 10:52:46 +0000 (19:52 +0900)]
scandir: Fix _D_ALLOC_NAMLEN() on OS/2 kLIBC
On OS/2 kLIBC, d_name is not the last field of struct dirent. So
copying struct dirent according to the size calculated based on d_name
blows the fields after d_name up.
The correct way is to allocate the whole size of struct dirent.
* lib/scandir.c (_D_ALLOC_NAMLEN): Consider the fields after d_name on
OS/2 kLIBC.
Jim Meyering [Tue, 29 Nov 2016 18:45:46 +0000 (10:45 -0800)]
dfa: avoid new infinite loop
This would infloop: echo cx | LC_ALL=C grep -E 'c\b[x ]'
* lib/dfa.c (dfastate): When constructing a new state table, we could
initially declare that we had found a match, and later find that
constraints eliminate that possibility, yet continue to use the
now stale "matched" indicator. That would lead to an infinite loop.
The solution is to update "matched" when necessary.
Introduced by commit v0.1-983-g403adf1.
Norihiro Tanaka [Mon, 28 Nov 2016 13:26:07 +0000 (22:26 +0900)]
dfa: do not match middle of multibyte character
* lib/dfa.c (transit_state): If it fails in matching a single byte
character in a state including a period expression in a non-UTF8
multibyte locale, skip the trailing bytes.
(dfa_supported): Revert previous change.
Jim Meyering [Sun, 27 Nov 2016 23:36:51 +0000 (15:36 -0800)]
dfa: avoid false match in non-UTF8 multibyte locales
* lib/dfa.c (dfa_supported): Treat any non-UTF8 multibyte locale
as "not supported" so that callers will resort to using regex-based
matcher. This will surely hurt performance, but correctness trumps
performance here, and the affected locales are less and less relevant,
these days. See grep's bug report https://bugs.gnu.org/24975.
Mike Frysinger [Sun, 27 Nov 2016 03:52:00 +0000 (22:52 -0500)]
ptsname_r: leverage AC_HEADER_MAJOR
Like the mountlist module, ptsname_r uses makedev/major/minor,
so use the existing autoconf macro which will probe some headers
for use and set up some defines.
* lib/md4.c (md4_process_bytes): The existing define is made internal
in recent versions of glibc, so also use this new public define.
* lib/md5.c (md5_process_bytes): Likewise.
* lib/sha1.c (sha1_process_bytes): Likewise.
* lib/sha256.c (sha256_process_bytes): Likewise.
* lib/sha512.c (sha512_process_bytes): Likewise.
Pádraig Brady [Sat, 26 Nov 2016 15:39:11 +0000 (15:39 +0000)]
maint: use a more standard return from mbrtowc test
With this we can use this check in coreutils to find configure issues:
grep -E '(program exited with status 1$|core dumped)' config.log
* m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): Don't return 1
from the test program as this often indicates an
unhandled case in the test program.
(gl_MBRTOWC_INCOMPLETE_STATE): Likewise.
(gl_MBRTOWC_SANITYCHECK): Likewise.
(gl_MBRTOWC_NULL_ARG2): Likewise.
(gl_MBRTOWC_NUL_RETVAL): Likewise.
Paul Eggert [Sat, 26 Nov 2016 22:53:29 +0000 (14:53 -0800)]
freopen: work around glibc bug with closed fd
Work around glibc bug#15589, where freopen mishandles the case
where stdin etc. are already closed.
* doc/posix-functions/freopen.texi (freopen): Document the bug.
* lib/freopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this
instead of __need_FILE, as the latter does not work with glibc.
Include <fcntl.h>, for open flags.
(rpl_freopen): Work around glibc bug.
* m4/freopen.m4 (gl_FUNC_FREOPEN): Check for bug.
* modules/freopen (Depends-on): Add fcntl-h.
* tests/test-freopen.c (main): Test for bug.
Paul Eggert [Fri, 25 Nov 2016 18:43:38 +0000 (10:43 -0800)]
dfa: fix glitches with on-demand states
Also, adjust commentary to better match new code.
Some of these glitches predate the recent change.
* lib/dfa.c (dfaanalyze): Clear trcount here, so that it counts
only non-initial states.
(dfastate): Rename locals to better match new roles.
Move them into nested scopes if this is easy.
Omit unnecessary cdalls to zeroset.
Simplify test for whether to throw in the positions of state 0.
Omit C99-ism (decl after statement) since Gawk still wants C89.
(build_state): Omit unnecessary test and assignment.
Fix some confusion that counted transition tables inaccurately
and could cause a memory leak.
(dfaexec_main): Redo to make it clearer to the compiler that
-1 and -2 are the only negative state numbers here.
Norihiro Tanaka [Fri, 25 Nov 2016 18:43:38 +0000 (10:43 -0800)]
dfa: addition of new state on demand
* src/dfa.c (dfastate): Add argument UC, the current input character.
Fill only a group including the character in transition table.
(realloc_trans_if_necessary): Add the dummy state which means that a
transition table is assigned but the next state is not assigned.
(build_state): Return the next state. All callers updated.
(transit_state_singlebyte): If we get the dummy state,
fill the transition table.
(dfaexec_main): Handle the dummy state.
(free_mbdata, dfafree): Consider the dummy state.
Daiki Ueno [Wed, 23 Nov 2016 11:46:09 +0000 (12:46 +0100)]
srclist: add "release" option
* config/srclist.txt: Change the format so that the first column
of each line points to the top-level directory of the source
archive.
* config/srclist-update: Accept "release" option that checks files
from the most recently tagged revision in the source archive.
Bruno Haible [Sun, 20 Nov 2016 12:24:27 +0000 (13:24 +0100)]
snippet/c++defs: Simplify _GL_CXXALIAS_* macros.
* build-aux/snippet/c++defs.h [__cplusplus && GNULIB_NAMESPACE]
(_GL_CXXALIAS_RPL_1, _GL_CXXALIAS_RPL_CAST_1,
_GL_CXXALIAS_SYS, _GL_CXXALIAS_SYS_CAST, _GL_CXXALIAS_SYS_CAST2):
Inline and remove member function 'rpl ()' of the wrapper struct.
Paul Eggert [Mon, 21 Nov 2016 04:16:29 +0000 (20:16 -0800)]
dfa: fix logic typo
Problem reported by Stephane Chazelas (Bug#24973).
* lib/dfa.c (using_simple_locale): Fix typo that caused some
non-simple locales like fr_FR to be treated as simple.
Jim Meyering [Sun, 20 Nov 2016 16:33:38 +0000 (08:33 -0800)]
fix test driver leaks: exclude, malloc, realloc
* tests/test-exclude.c (main): Fix trivial leak.
* tests/test-malloc-gnu.c (main): Likewise.
* tests/test-realloc-gnu.c (main): Likewise.
With these changes, grep's tests are now leak free.
I.e., running them with ASAN elicits no failure:
make CFLAGS='-O0 -ggdb3' AM_CFLAGS=-fsanitize=address \
AM_LDFLAGS='-fsanitize=address -static-libasan' check
Pedro Alves [Sat, 12 Nov 2016 16:22:54 +0000 (17:22 +0100)]
GNULIB_NAMESPACE::func need not pull in rpl_func
* build-aux/snippet/c++defs.h [__cplusplus && GNULIB_NAMESPACE]
(_GL_CXXALIAS_RPL_1, _GL_CXXALIAS_RPL_CAST_1, _GL_CXXALIAS_SYS)
(_GL_CXXALIAS_SYS_CAST, _GL_CXXALIAS_SYS_CAST2): Define a wrapper
struct instead of a function pointer.
Bruno Haible [Sun, 13 Nov 2016 03:03:39 +0000 (04:03 +0100)]
Relicense some modules under LGPLv2+.
Paul Eggert's approval is in
http://lists.gnu.org/archive/html/bug-gnulib/2016-11/msg00037.html.
Eric Blake's approval is in
http://lists.gnu.org/archive/html/bug-gnulib/2016-11/msg00042.html.
Ludovic Courtès's approval is in
http://lists.gnu.org/archive/html/bug-gnulib/2016-11/msg00038.html.
* modules/isnand-nolibm (License): Change to LGPLv2+.
* modules/isnanf-nolibm (License): Likewise.
* modules/isnanl-nolibm (License): Likewise.
Bruno Haible [Sun, 13 Nov 2016 02:58:45 +0000 (03:58 +0100)]
Relicense some modules under LGPLv2+.
lib/float+.h is already under LGPLv2+ since 2007-07-13, per
modules/vasnprintf.
Paolo Bonzini's approval for lib/frexp.c and lib/frexpl.c is in
http://lists.gnu.org/archive/html/bug-gnulib/2016-11/msg00074.html.
All other significant changes to the files in lib/ of these modules
are from me.
* modules/memcmp2 (License): Change to LGPLv2+.
* modules/amemxfrm (License): Likewise.
* modules/fpieee (License): Likewise.
* modules/fpucw (License): Likewise.
* modules/frexp-nolibm (License): Likewise.
* modules/frexpl-nolibm (License): Likewise.
* modules/printf-frexp (License): Likewise.
* modules/printf-frexpl (License): Likewise.
* modules/printf-safe (License): Likewise.
* modules/signbit (License): Likewise.
Pedro Alves [Mon, 14 Nov 2016 23:08:21 +0000 (23:08 +0000)]
snippet/c++defs: fix real-floating arg functions in C++ mode
Also, define isfinite, isinf, isnan, signbit in the gnulib
namespace instead of in the global namespace.
* build-aux/snippet/c++defs.h (_GL_BEGIN_NAMESPACE)
(_GL_END_NAMESPACE): New.
* lib/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Use them.
(isfinite, isinf, isnan, signbit) [__cplusplus &&
GNULIB_NAMESPACE]: Define them in the GNULIB_NAMESPACE namespace
instead of in the global namespace.
* tests/test-math-c++.cc: Check that the isfinite, isinf, isnan,
signbit overloads exist in the GNULIB_NAMESPACE namespace, instead
of in the global namespace.
Jim Meyering [Mon, 14 Nov 2016 02:15:36 +0000 (18:15 -0800)]
strftime: don't use __THROW
Each use of __THROW would provoke this from gcc-7-to-be:
lib/strftime.c:371:1: warning: '__leaf__' attribute has no effect \
on unit local functions [-Wattributes]
static int iso_week_days (int, int) __THROW;
^~~~~~
* lib/strftime.c (__THROW): Don't define.
Remove each use of __THROW.
* lib/strftime.c (memcpy_lowcase, memcpy_uppcase): Remove __THROW.
(tm_diff, iso_week_days, __strftime_internal): Likewise.
Paul Eggert [Tue, 15 Nov 2016 03:48:28 +0000 (19:48 -0800)]
obstack: port to gcc -fcheck-pointer-bounds
Problem found by 'make check' failure on bleeding-edge coreutils
on an MPX-enabled CPU (Intel Core i3-7100U) running GCC (Ubuntu
6.2.0-5ubuntu12), configured via "./configure
--enable-gcc-warnings CFLAGS='-mmpx -fcheck-pointer-bounds -g3
-O2' LDFLAGS='-static-libmpx -static-libmpxwrappers'".
* lib/obstack.h (__FLEXIBLE_ARRAY_MEMBER):
New macro, copied from fts_.h.
(struct _obstack_chunk.contents): Use it.
Eric Blake [Mon, 14 Nov 2016 21:36:51 +0000 (15:36 -0600)]
strerror_r-posix: Another fix, for HAVE_DECL_STRERROR_R on mingw
Commit 5ddd9d7 improved strerror_r on glibc systems (where
STRERROR_R_CHAR_P was defined twice with different values), but
missed mingw systems (where HAVE_DECL_STRERROR_R is now defined
twice with different values). Avoid the AC_CHECK_DECLS[_ONCE]
and AC_CHECK_FUNCS[_ONCE] m4 macros that call AC_DEFINE under the
hood, and instead limit our checks to just setting shell witnesses,
so that compilation on mingw doesn't trigger warnings (and mess up
subsequent tests that use -Werror) about a redefined C preprocessor
macro.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R, gl_FUNC_STRERROR_R_WORKS):
Avoid calling macros that may supply a conflicting AC_DEFINE().
Bruno Haible [Sun, 13 Nov 2016 03:12:26 +0000 (04:12 +0100)]
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
* gnulib-tool (--lgpl): Accept value 3orGPLv2.
(func_import): Extend determination of license_incompatibilities.
(func_create_testdir): Extend table of license compatibility. Handle
also the licenses GPLv3+, GPL, LGPLv3+.
Paul Eggert [Sun, 13 Nov 2016 01:26:39 +0000 (17:26 -0800)]
Merge strftime.c changes from glibc
This incorporates:
2007-10-16 [BZ #5184] Add tzset_called argument
2008-06-13 [BZ #6612] pass reference to tzset_called around
2009-10-30 Implement Burmese language locale for Myanmar
2010-01-09 Add support for XPG7 testing
2015-09-26 [BZ #18985] out of range data to strftime() causes a segfault
2015-10-20 Convert miscellaneous function definitions to prototype style
* lib/strftime.c: Copy glibc license, since gnulib-tool rewrites
it anyway and this lessens the difference between gnulib and glibc.
(USE_IN_EXTENDED_LOCALE_MODEL) [_LIBC]: Define.
(__THROW): Define if standard headers do not.
(LOCALE_PARAM): Rename from LOCALE_PARAM_PROTO. All uses changed.
(memcpy_locase, memcpy_uppcase, tm_diff, __strftime_internal):
Declare with __THROW.
(__strftime_internal): Rename from strftime_case_. Add arg for
whether tzset is called. All uses changed. Call tzset at most
once. Allow %OC, for Burmese.
(a_wkday, f_wkday, a_month, f_month) [_NL_CURRENT]:
Don't assume values are in range.
Eric Blake [Fri, 4 Nov 2016 19:06:39 +0000 (14:06 -0500)]
strerror_r-posix: Fix override of AC_FUNC_STRERROR_R
Requiring autoconf's AC_FUNC_STRERROR_R and then calling AC_DEFINE
ourselves leads to two insertions of #define STRERROR_R_CHAR_P
in confdefs.h, but with different values (at least on glibc). This
in turn sparks a gcc warning about redeclaring the macro, and kills
any subsequent tests that use -Werror (which now error because of
the conflicting define, whether or not the test used to error).
A better approach is to replace the autoconf macro with a version
of our own that doesn't probe anything, so that the AC_DEFINE is
reached exactly once.
* m4/strerror_r.m4 (AC_FUNC_STRERROR_R): New override.
(gl_FUNC_STRERROR_R): Don't reuse AC_DEFINE() with a potentially
different value.
Pedro Alves [Sat, 12 Nov 2016 16:22:54 +0000 (16:22 +0000)]
GNULIB_NAMESPACE::func need not pull in rpl_func
* build-aux/snippet/c++defs.h [__cplusplus && GNULIB_NAMESPACE]
(_GL_CXXALIAS_RPL_1, _GL_CXXALIAS_RPL_CAST_1, _GL_CXXALIAS_SYS)
(_GL_CXXALIAS_SYS_CAST, _GL_CXXALIAS_SYS_CAST2): Define a wrapper
struct instead of a function pointer.
* m4/manywarnings.m4: Fix -Wno-missing-field-initializers detection
to be independent of -Wunused-variable. I.E. ensure the latter
warning doesn't occur so that detection of the former is accurate.
Pádraig Brady [Mon, 7 Nov 2016 12:50:24 +0000 (12:50 +0000)]
non-recursive-gnulib-prefix-hack: revert use of parameterized 'lib' dir
This reverts commit df6f91c as the evaluation of the passed shell
variable happens at the wrong time in the references generated by
m4/non-recursive-gnulib-prefix-hack.m4
Revert to the hardcoded "lib/".
Paul Eggert [Fri, 4 Nov 2016 04:34:58 +0000 (21:34 -0700)]
intprops: port to older XL C
Problem reported by Alexander Samoilov in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00166.html
http://savannah.nongnu.org/bugs/?49448
* lib/intprops.h (_GL_HAVE___TYPEOF__) [__IBM__TYPEOF__]:
Define to 1 only for XL C 12.1 or later, since this bug
occurs in XL C for AIX 6.0 but not in 12.1.
Paul Eggert [Tue, 1 Nov 2016 15:55:17 +0000 (08:55 -0700)]
utimensat: remove FIXME for old Linux kernels
* lib/utimensat.c (rpl_utimensat): Update FIXME comment.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Belatedy do a "simplify
this in 2012" FIXME, by assuming the file system bug is absent
unless demonstrated to be present. We no longer need to worry
about Linux kernel 2.6.32 when building with newer kernels.
Bruno Haible [Sun, 16 Oct 2016 20:11:32 +0000 (22:11 +0200)]
qsort_r: Fix macrology for platforms that lack the function.
* m4/stdlib_h.m4 (gl_STDLIB_H): Check for qsort_r.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_QSORT_R.
* modules/stdlib (Makefile.am): Substitute HAVE_QSORT_R.
* lib/stdlib.in.h (qsort_r): Provide declaration if the function does
not exist.
* m4/qsort_r.m4 (gl_FUNC_QSORT_R): Use AC_CHECK_FUNCS to test whether
the function exists.
* modules/qsort_r: Add comments.
See Bug#24805.
* lib/getprogname.c (getprogname) [__hpux]: Port.
* tests/test-getprogname.c (STREQ) [__hpux]:
Special-case for HP-UX limitations on program name length.