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:53 +0000 (17:22 +0100)]
Fix gnulib C++ namespace support and std::frexp
* lib/math.in.h (frexp): Use _GL_CXXALIASWARN1 instead of
_GL_CXXALIASWARN.
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 [Sat, 12 Nov 2016 00:17:26 +0000 (01:17 +0100)]
libunistring: Relicense under dual "LGPLv3+ or GPLv2" license.
* modules/libunistring: (License): Change from LGPL to
"LGPLv3+ or GPLv2".
* modules/libunistring-optional: Likewise.
* modules/unicase/*: Likewise.
* modules/uniconv/*: Likewise.
* modules/unictype/*: Likewise.
* modules/unigbrk/*: Likewise.
* modules/unilbrk/*: Likewise.
* modules/uniname/*: Likewise.
* modules/uninorm/*: Likewise.
* modules/unistdio/*: Likewise.
* modules/unistr/*: Likewise.
* modules/uniwbrk/*: Likewise.
* modules/uniwidth/*: Likewise.
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.
Karl Berry [Sat, 19 Nov 2016 14:45:25 +0000 (06:45 -0800)]
autoupdate
Bruno Haible [Thu, 17 Nov 2016 10:51:55 +0000 (11:51 +0100)]
Enable Unicode decoder safety unconditionally.
* lib/unistr.in.h (u32_mbtouc_unsafe): Assume CONFIG_UNICODE_SAFETY.
* lib/unistr/u8-mblen.c (u8_mblen): Likewise.
* lib/unistr/u8-mbtouc-unsafe.c (u8_mbtouc_unsafe): Likewise.
* lib/unistr/u8-mbtouc-unsafe-aux.c (u8_mbtouc_unsafe_aux): Likewise.
* lib/unistr/u8-prev.c (u8_prev): Likewise.
* lib/unistr/u8-strmblen.c (u8_strmblen): Likewise.
* lib/unistr/u8-strmbtouc.c (u8_strmbtouc): Likewise.
* lib/unistr/u16-mblen.c (u16_mblen): Likewise.
* lib/unistr/u16-mbtouc-unsafe.c (u16_mbtouc_unsafe): Likewise.
* lib/unistr/u16-mbtouc-unsafe-aux.c (u16_mbtouc_unsafe_aux): Likewise.
* lib/unistr/u16-prev.c (u16_prev): Likewise.
* lib/unistr/u16-strmblen.c (u16_strmblen): Likewise.
* lib/unistr/u16-strmbtouc.c (u16_strmbtouc): Likewise.
* lib/unistr/u32-mblen.c (u32_mblen): Likewise.
* lib/unistr/u32-mbtouc-unsafe.c (u32_mbtouc_unsafe): Likewise.
* lib/unistr/u32-prev.c (u32_prev): Likewise.
* lib/unistr/u32-next.c (u32_next): Likewise.
* lib/unistr/u32-strmblen.c (u32_strmblen): Likewise.
* lib/unistr/u32-strmbtouc.c (u32_strmbtouc): Likewise.
* lib/uniconv/u8-conv-to-enc.c (u8_conv_to_encoding): Likewise.
* lib/uniconv/u8-strconv-to-enc.c (u8_strconv_to_encoding): Likewise.
* tests/unistr/test-u16-prev.c (check_invalid): Enable the
CONFIG_UNICODE_SAFETY tests unconditionally.
* tests/unistr/test-u32-mblen.c (main): Likewise.
* tests/unistr/test-u32-mbtouc.h (test_function): Likewise.
* tests/unistr/test-u32-prev.c (check_invalid): Likewise.
* tests/unistr/test-u32-next.c (main): Likewise.
* tests/unistr/test-u32-strmblen.c (main): Likewise.
* tests/unistr/test-u32-strmbtouc.c (main): Likewise.
* tests/unistr/test-u32-mbtouc.c (FULL_SAFETY): Remove macro.
* lib/unistr/u8-check.c (u8_check): Remove old dead code.
* lib/unistr/u8-mbtouc.c (u8_mbtouc): Likewise.
* lib/unistr/u8-mbtouc-aux.c (u8_mbtouc_aux): Likewise.
* lib/unistr/u8-mbtoucr.c (u8_mbtoucr): Likewise.
* lib/unistr/u8-uctomb.c (u8_uctomb): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* lib/unistr/u16-check.c (u16_check): Update comment.
* NEWS: Mention the changes that callers should be aware of.
Bruno Haible [Sat, 19 Nov 2016 13:07:58 +0000 (14:07 +0100)]
Correct indentation.
Bruno Haible [Sat, 19 Nov 2016 13:03:07 +0000 (14:03 +0100)]
relocatable-prog-wrapper: Fix breakage on Cygwin.
* modules/relocatable-prog-wrapper (Files): Add lib/stat.c, lib/lstat.c.
(Depends-on): Remove intprops.
* lib/relocwrapper.c: Update dependency tree.
(strerror): Undefine.
* build-aux/install-reloc (func_create_wrapper): Do not compile
strerror.c and strerror-override.c. Erase stat.o and lstat.o.
Bruno Haible [Sat, 19 Nov 2016 11:50:28 +0000 (12:50 +0100)]
strerror: Make it compile in C++ mode.
* lib/strerror.c (strerror): Ignore the return value of memcpy().
Pedro Alves [Tue, 15 Nov 2016 02:36:00 +0000 (02:36 +0000)]
sys_time: add gnulib::timeval for C++
* lib/sys_time.in.h [__cplusplus && defined GNULIB_NAMESPACE]:
Define "timeval" in the GNULIB_NAMESPACE namespace, and #undef any
timeval macro.
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().
Signed-off-by: Eric Blake <eblake@redhat.com>
Pádraig Brady [Mon, 14 Nov 2016 20:07:39 +0000 (20:07 +0000)]
strptime: fix compile error in recent change
* lib/strptime.c (__strptime_internal): Fix ported code.
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:40:26 +0000 (17:40 -0800)]
strftime: tune %q
* lib/strftime.c (__strftime_internal): Assume tp->tm_mon is in range.
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.
Signed-off-by: Eric Blake <eblake@redhat.com>
Pedro Alves [Sat, 12 Nov 2016 16:22:53 +0000 (16:22 +0000)]
Fix gnulib C++ namespace support and std::frexp
* lib/math.in.h (frexp): Use _GL_CXXALIASWARN1 instead of
_GL_CXXALIASWARN.
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.
Frediano Ziglio [Wed, 9 Nov 2016 11:21:51 +0000 (06:21 -0500)]
manywarnings: fix -Wno-missing-field-initializers detection
* 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/".
Pádraig Brady [Wed, 19 Oct 2016 21:46:14 +0000 (14:46 -0700)]
strftime,strptime: support %q to represent the quarter
* lib/strftime.c (strftime_case_): Add %q case.
* lib/strptime.c (__strptime_internal): Likewise.
* tests/test-strftime.c (quarter_test): A new test case.
Karl Berry [Fri, 4 Nov 2016 15:32:09 +0000 (08:32 -0700)]
autoupdate
Eric Blake [Thu, 3 Nov 2016 18:50:30 +0000 (13:50 -0500)]
bootstrap: Fix get_version() for AIX 5.3
* build-aux/bootstrap (get_version): Factor out sed script, since
indented comments choke AIX 5.3 sed.
Reported-by: Michael Felt <aixtools@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
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.
Karl Berry [Thu, 3 Nov 2016 13:52:50 +0000 (06:52 -0700)]
autoupdate
Pádraig Brady [Wed, 2 Nov 2016 17:52:12 +0000 (17:52 +0000)]
backupfile: initialize default suffix within the implementation
* lib/backupfile.c (find_backup_file_name): Initialize the
global variable here, to simplify usage, and to only call
getenv() when needed.
Paul Eggert [Tue, 1 Nov 2016 22:38:59 +0000 (15:38 -0700)]
futimens: remove FIXME for old Linux kernels
* m4/futimens.m4 (gl_FUNC_FUTIMENS): Belatedy do a "simplify
this in 2012" FIXME, like that for utimensat.
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.
Paul Eggert [Thu, 27 Oct 2016 16:12:16 +0000 (09:12 -0700)]
maint: update how to make web pages
* doc/README: Update to match what I did today.
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.
Paul Eggert [Thu, 27 Oct 2016 01:10:37 +0000 (18:10 -0700)]
sys_types: fix Texinfo typos
* doc/glibc-functions/gnu_dev_major.texi:
* doc/glibc-functions/gnu_dev_makedev.texi:
* doc/glibc-functions/gnu_dev_minor.texi: Fix typos.
John David Anglin [Thu, 27 Oct 2016 00:16:01 +0000 (17:16 -0700)]
getprogname: port to HP-UX
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.
Bruno Haible [Fri, 21 Oct 2016 01:09:23 +0000 (03:09 +0200)]
Update doc about target platforms.
* doc/gnulib-intro.texi (Target Platforms): Update list.
Bruno Haible [Sat, 15 Oct 2016 13:23:34 +0000 (15:23 +0200)]
opendir, readdir, closedir: Relicense under LGPLv2+.
* modules/opendir (License): Change to LGPLv2+.
* modules/readdir (License): Likewise.
* modules/closedir (License): Likewise.
Bruno Haible [Sun, 16 Oct 2016 15:45:52 +0000 (17:45 +0200)]
Fix conflict between strerror_r-posix module and AC_FUNC_STRERROR_R.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Override the values set by the
AC_FUNC_STRERROR_R macro. Define HAVE_DECL_STRERROR_R_ORIG.
* lib/strerror_r.c: Use HAVE_DECL_STRERROR_R_ORIG instead of
HAVE_DECL_STRERROR_R.
Bruno Haible [Sun, 16 Oct 2016 15:43:53 +0000 (17:43 +0200)]
Make the 'argp' module work without the 'error' module.
* m4/argp.m4 (gl_ARGP): Require AC_FUNC_STRERROR_R.
Paul Eggert [Tue, 25 Oct 2016 21:59:29 +0000 (14:59 -0700)]
diffseq: restore TOO_EXPENSIVE heuristic
* lib/diffseq.h: Problem with diffutils reported by Andreas Schwab
(Bug#24715). The simplest solution is to restore the
TOO_EXPENSIVE heuristic that I added to GNU diff in 1993, while
using a higher threshold to avoid Bug#16848 on smaller files.
* lib/diffseq.h (struct context): Restore member too_expensive.
(struct partition): Restore members lo_minimal, hi_minimal.
(diag, compareseq): Restore arg find_minimal. All uses changed.
(diag): Restore the TOO_EXPENSIVE heuristic that I added back in
1993 to make 'diff' run faster (but not as well) on large inputs,
but use a threshold of 4096 instead of the old 256.
* lib/fstrcmp.c (strcmp_bounded):
* lib/git-merge-changelog.c (compute_differences):
Adjust to diffseq.h changes.
Bruno Haible [Sat, 22 Oct 2016 17:17:26 +0000 (19:17 +0200)]
non-recursive-gnulib-prefix-hack: Don't make assumptions about gnulib-tool's --source-base option value.
* modules/non-recursive-gnulib-prefix-hack (configure.ac): Use
gl_source_base.
Bruno Haible [Sat, 22 Oct 2016 21:04:03 +0000 (23:04 +0200)]
iconv: Avoid compilation error when bootstrapping GNU libiconv.
* m4/iconv.m4 (AM_ICONV): When the system does not have an iconv()
declaration yet, define ICONV_CONST to empty.
Bruno Haible [Sat, 15 Oct 2016 13:51:20 +0000 (15:51 +0200)]
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
* gnulib-tool (func_get_license): Special-case the 'parse-datetime'
module.
Bruno Haible [Mon, 17 Oct 2016 00:16:57 +0000 (02:16 +0200)]
system-quote tests: Avoid compiler warning on AIX.
* tests/test-system-quote-child.c (fopen): Redefine like the system's
<stdio.h> does.
Bruno Haible [Sun, 16 Oct 2016 14:59:45 +0000 (16:59 +0200)]
Fix some "gcc -Wall" warnings.
* tests/test-ffsl.c (main): Use variable x, not i.
* tests/test-posix_spawn3.c (parent_main): Consider the return value of
freopen.
* tests/test-sethostname1.c (main): Explicitly ignore the return value
of sethostname.
Bruno Haible [Sun, 16 Oct 2016 12:11:18 +0000 (14:11 +0200)]
gnulib-tool: Make --create-testdir on all modules work again.
* gnulib-tool (func_create_testdir): Don't include the
non-recursive-gnulib-prefix-hack module.
Daiki Ueno [Thu, 20 Oct 2016 07:45:50 +0000 (09:45 +0200)]
libunistring: change the maintainer to 'all'
* modules/gen-uni-tables, modules/libunistring:
* modules/ucs4-utf16, modules/ucs4-utf8, modules/unicodeio:
* modules/unitypes, modules/utf16-ucs4, modules/utf16-ucs4-unsafe:
* modules/utf8-ucs4, modules/utf8-ucs4-unsafe:
* modules/unicase/*, modules/uniconv/*, modules/unictype/*:
* modules/unilbrk/*, modules/uniname/*, modules/uninorm/*:
* modules/unistdio/*, modules/unistr/*, modules/uniwbrk/*:
* modules/uniwidth/*: Change the maintainer to 'all'.
Bruno Haible [Sun, 16 Oct 2016 13:54:45 +0000 (15:54 +0200)]
Simplify "configure: checking ..." messages.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Use AC_MSG_CHECKING instead of
AC_MSG_NOTICE.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.
Bruno Haible [Sun, 16 Oct 2016 14:09:29 +0000 (16:09 +0200)]
Simplify "configure: checking ..." messages.
* m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Use AC_MSG_CHECKING instead of
AC_MSG_NOTICE.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.
Paul Eggert [Thu, 20 Oct 2016 22:35:02 +0000 (15:35 -0700)]
quotearg-tests: pacify gcc -Wall
Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00066.html
* tests/test-quotearg-simple.c (use_quote_double_quotes): Move here ...
* tests/test-quotearg.h: ... from here.
Pádraig Brady [Thu, 20 Oct 2016 18:28:07 +0000 (11:28 -0700)]
canonicalize-lgpl: fix for missing SIZE_MAX on older systems
* lib/canonicalize-lgpl.c [SIZE_MAX]: Define if needed.
Needed on Centos <= 4.
Jim Meyering [Thu, 20 Oct 2016 16:32:54 +0000 (09:32 -0700)]
printf.m4: fix a bug in detecting printf %j support
* m4/printf.m4 (gl_PRINTF_SIZES_C99): Fail any system for which
uintmax_t is defined in neither stdint.h nor inttypes.h.
Before, this macro might have mistakenly set
gl_cv_func_printf_sizes_c99=yes on such a system.
Spotted by Zev Weiss.
Paul Eggert [Thu, 20 Oct 2016 06:46:10 +0000 (23:46 -0700)]
sched: substitute HAVE_SYS_CDEFS_H too
Problem reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00084.html
* m4/sched_h.m4 (gl_SCHED_H): Set and substitute HAVE_SYS_CDEFS_H.
* modules/sched (Depends-on): Substitute HAVE_SYS_CDEFS_H.
Pádraig Brady [Tue, 18 Oct 2016 20:00:07 +0000 (13:00 -0700)]
quotearg: never write beyond the returned length
* lib/quotearg.c (quotearg_buffer_restyled): Switch to a read-only
scan of the string when we initially encounter a single quote when
shell quoting, so that if we then switch to a more concise quoting method
we will not have written beyond that returned length.
This is significant for sh-quote, which has separate routines
to determine the length and do the actual quoting.
* tests/test-quotearg.h: Reinstate the buffer bounds checking
now that we never write more than the returned length.
Bruno Haible [Tue, 18 Oct 2016 22:33:01 +0000 (00:33 +0200)]
getprogname tests: Avoid failure in packages that use libtool.
* tests/test-getprogname.c (main): Strip "lt-" prefix.
Based on a patch by Jim Meyering.
Bruno Haible [Sun, 16 Oct 2016 11:53:18 +0000 (13:53 +0200)]
getprogname: Fix test failure on Cygwin. Comments.
* lib/getprogname.h: Add comments.
* lib/getprogname.c: Add comments. Fix #elif indentation.
* tests/test-getprogname.c (main): On Cygwin, expect a result without
".exe" suffix.
Bruno Haible [Sun, 16 Oct 2016 18:07:37 +0000 (20:07 +0200)]
Make sure the libunistring detection rejects older versions with a known bug.
* modules/unistr/u8-strtok (configure.ac): Bump required version.
* modules/unistr/u16-strtok (configure.ac): Likewise.
* modules/unistr/u32-strtok (configure.ac): Likewise.
Bruno Haible [Tue, 18 Oct 2016 12:10:01 +0000 (14:10 +0200)]
sh-quote, system-quote: revert regression of unit test.
* tests/test-sh-quote.c (check_one): Do detect buffer overruns.
* tests/test-system-quote-main.c (check_one): Likewise.
Pádraig Brady [Sun, 16 Oct 2016 21:51:30 +0000 (22:51 +0100)]
quotearg: fix stale tests
* tests/test-quotearg.c [locale_results]: Add the missing str7
entries to the expected results.
tests/test-system-quote-main.c (check_one): Don't enforce that we
don't write beyond the returned length, since that's no longer the
case if we switch to a more concise quoting style.
* tests/test-sh-quote.c (check_one): Likewise.
(main): Adjust for the new more concise quoting style.
Reported by Bruno Haible.
Jim Meyering [Sun, 16 Oct 2016 20:24:09 +0000 (13:24 -0700)]
non-recursive-gnulib-prefix-hack: fix inconsequential typo
* m4/non-recursive-gnulib-prefix-hack.m4: Change a hard-coded "lib"
to "$1". This macro is always invoked with $1 == lib.
Spotted by Bruno Haible
Bruno Haible [Sun, 16 Oct 2016 18:09:16 +0000 (20:09 +0200)]
Fix a test crash.
* tests/test-duplocale.c (main): Skip the test if the 'newlocale' call
fails.
Pádraig Brady [Sat, 15 Oct 2016 22:29:16 +0000 (23:29 +0100)]
test-limits-h: suppress -Woverlength-strings
* tests/test-limits-h.c [__GNUC__]: Ignore -Woverlength-strings.
Bruno Haible [Sat, 15 Oct 2016 13:09:13 +0000 (15:09 +0200)]
gettime, timespec, utimens: Relicense under LGPL.
* modules/gettime (License): Change to LGPL.
* modules/timespec (License): Likewise.
* modules/utimens (License): Likewise.
Bruno Haible [Fri, 14 Oct 2016 00:49:05 +0000 (02:49 +0200)]
canonicalize-lgpl: Support the case path_max > INT_MAX.
* lib/canonicalize-lgpl.c (__realpath): Declare n as ssize_t, not int.
Jim Meyering [Thu, 13 Oct 2016 21:59:10 +0000 (14:59 -0700)]
getprogname: IBM z/OS: avoid NULL-dereference
* lib/getprogname.c (getprogname) [__MVS__]: Don't dereference NULL
upon strdup failure.
Jim Meyering [Wed, 12 Oct 2016 19:30:07 +0000 (12:30 -0700)]
test-stdint: use _GL_VERIFY rather than "verify" for some tests
* tests/test-stdint.c (verify_width): Implement with _GL_VERIFY
and an abbreviated diagnostic rather than verify with the full one,
because the full-length strings would evoke warnings from gcc with
-Woverlength-strings.
Paul Eggert [Thu, 13 Oct 2016 18:31:23 +0000 (11:31 -0700)]
Add missing ChangeLog entry
Paul Eggert [Thu, 13 Oct 2016 18:16:40 +0000 (11:16 -0700)]
stdint: port SIZE_MAX to glibc s390
Problem reported by Eric Blake in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00031.html
* doc/posix-headers/stdint.texi (stdint.h): Document the fix.
* m4/stdint.m4 (gl_STDINT_H): Check that SIZE_MAX has the
correct type, if possible.
Daniel Richard G [Thu, 13 Oct 2016 08:42:42 +0000 (09:42 +0100)]
getprogname: port to IBM z/OS
* lib/getprogname.c (getprogname): Use w_getpsent() to get the name.
Jim Meyering [Wed, 12 Oct 2016 04:41:57 +0000 (21:41 -0700)]
maint: remove stray space after "." in AC_DEFINE comment.
* m4/st_dm_mode.m4 (AC_STRUCT_ST_DM_MODE): Remove space-after-".".
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.
Jim Meyering [Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)]
long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
* lib/long-options.c (parse_long_options): Add a break statement
to avoid this new warning/failure:
$ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \
--create-testdir --dir=/t/x --with-tests --test long-options
../../gllib/long-options.c: In function 'parse_long_options':
../../gllib/long-options.c:66:12: error: this statement may \
fall through [-Werror=implicit-fallthrough]
(*usage_func) (EXIT_SUCCESS);
~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Meyering [Wed, 5 Oct 2016 16:13:55 +0000 (09:13 -0700)]
utimecmp: avoid new GCC 7 warning from -Wbool-operation
Testing this module would fail when using GCC 7 like this:
$ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \
--dir=/tmp/x --with-tests --test utimecmp
../../gllib/utimecmp.c: In function ‘utimecmp’:
../../gllib/utimecmp.c:291:36: error: ‘~’ on a boolean expression \
[-Werror=bool-operation]
time_t s = src_s & ~ (res == 2 * BILLION);
^
../../gllib/utimecmp.c:370:16: error: ‘~’ on a boolean expression \
[-Werror=bool-operation]
src_s &= ~ (res == 2 * BILLION);
^
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.
Instead, make it explicit that we intend to apply it to 0 or 1.
Norihiro Tanaka [Mon, 10 Oct 2016 14:08:29 +0000 (23:08 +0900)]
dfa: save memory for states
* src/dfa (dfaexec_main): Beginning of dfa execution, release caches of
states if dfa has a lot of caches.
Eli Zaretskii [Mon, 10 Oct 2016 15:05:36 +0000 (08:05 -0700)]
wchar, wctype-h: fix for MinGW 3.22.2
* lib/wchar.in.h [__MINGW32__]: Add one more condition for
special invocation, to fix issues with MinGW 3.22.2 wchar.h
when included from <string.h>.
* lib/wctype.in.h [__MINGW32__]: Add special invocation
convention for MinGW 3.22.2, to solve issues with their
wctype.h when included from <ctype.h>.
Jim Meyering [Wed, 5 Oct 2016 17:43:09 +0000 (10:43 -0700)]
long-options: avoid new GCC 7 warning from -Wimplicit-fallthrough
* lib/long-options.c (parse_long_options): Add a break statement
to avoid this new warning/failure:
$ CFLAGS='-O -Werror=implicit-fallthrough' ./gnulib-tool \
--create-testdir --dir=/t/x --with-tests --test long-options
../../gllib/long-options.c: In function ‘parse_long_options’:
../../gllib/long-options.c:66:12: error: this statement may \
fall through [-Werror=implicit-fallthrough]
(*usage_func) (EXIT_SUCCESS);
~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Meyering [Wed, 5 Oct 2016 16:13:55 +0000 (09:13 -0700)]
utimecmp: avoid new GCC 7 warning from -Wbool-operation
Testing this module would fail when using GCC 7 like this:
$ CFLAGS='-O -Werror=bool-operation' ./gnulib-tool --create-testdir \
--dir=/tmp/x --with-tests --test utimecmp
../../gllib/utimecmp.c: In function ‘utimecmp’:
../../gllib/utimecmp.c:291:36: error: ‘~’ on a boolean expression \
[-Werror=bool-operation]
time_t s = src_s & ~ (res == 2 * BILLION);
^
../../gllib/utimecmp.c:370:16: error: ‘~’ on a boolean expression \
[-Werror=bool-operation]
src_s &= ~ (res == 2 * BILLION);
^
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.
Instead, make it explicit that we intend to apply it to 0 or 1.
Karl Berry [Mon, 3 Oct 2016 21:26:04 +0000 (14:26 -0700)]
autoupdate
Pádraig Brady [Mon, 26 Sep 2016 14:13:34 +0000 (15:13 +0100)]
quotearg: minimize shell quoting using double quotes
I.E. 'it'\''s awkward like this'; "it's better like this"
* lib/quotearg.c (quotearg_buffer_restyled): If an ASCII single
quote in encountered then use double quotes (c style quoting)
when possible, as it simplifies the quoting.
* tests/test-quotearg-simple.c: Add test cases.
* tests/test-quotearg.h (use_quotearg_buffer): Adjust to account
for the fact we now may write beyond the returned length.
Jim Meyering [Sun, 2 Oct 2016 19:09:13 +0000 (12:09 -0700)]
vasnprintf.c: avoid spurious warning from GCC 7
The presence of cpp directives renders this "FALLTHROUGH" comment
ineffective, so does not suppress the -Wimplicit-fallthrough warning
from GCC 7 built from git on 2016-10-02.
* lib/vasnprintf.c (VASNPRINTF): Move comment down past two cpp
directives, so that it takes effect once again. This is clearly
not a proper change, and I will revert it once this bug is fixed:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77817
Jim Meyering [Sun, 2 Oct 2016 02:53:52 +0000 (19:53 -0700)]
getprogname: correct the test for a __progname variable
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Use AC_CACHE_CHECK
and AC_LINK_IFELSE to check for a global __progname. If found,
define HAVE_VAR___PROGNAME.
* lib/getprogname.c (getprogname): Reflect the new name of the
preprocessor symbol: s/HAVE_DECL___PROGNAME/HAVE_VAR___PROGNAME/
Assaf Gordon reported that the erroneous prior check caused
link failure on AIX 7 in
https://lists.gnu.org/archive/html/grep-devel/2016-10/msg00001.html
Jim Meyering [Thu, 29 Sep 2016 04:36:55 +0000 (21:36 -0700)]
u8-uctomb-aux.c: build: placate GCC 7's new -Wimplicit-fallthrough
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Mark each end of
fall-through case with a /* fallthrough */ comment.
Jim Meyering [Thu, 29 Sep 2016 04:20:38 +0000 (21:20 -0700)]
dfa: build: avoid warning from GCC 7's new -Wimplicit-fallthrough
* lib/dfa.c (dfassbuild): Mark the end of this case with a
/* fallthrough */ comment.
Jim Meyering [Thu, 29 Sep 2016 03:57:24 +0000 (20:57 -0700)]
getprogname: avoid __progname vs program_invocation_short_name pitfall
I.e., don't let the OpenBSD 5.1 fix induce failure when using newer
glibc. Would have caused failure with Fedora 25's glibc-2.24-3, but
not with Fedora 24's glibc-2.23.1-10.
* lib/getprogname.c (__progname): Move this declaration down...
(getprogname): ... into the #elif block where used, and make it
explicitly "extern".
Jim Meyering [Wed, 28 Sep 2016 18:09:03 +0000 (11:09 -0700)]
getprogname: port to OpenBSD 5.1
* lib/getprogname.c (__progname) [HAVE_DECL___PROGNAME]: Declare.
(getprogname) [HAVE_DECL___PROGNAME]: Return __progname or "?".
* modules/getprogname (configure.ac): Move most of this code...
* m4/getprogname.m4 (gl_FUNC_GETPROGNAME): ... to this function,
increment serial number, and add a test for __progname.
https://bugs.gnu.org/24562
Reported by Nelson H. F. Beebe.
Paul Eggert [Sun, 25 Sep 2016 04:10:12 +0000 (21:10 -0700)]
sched: port to GCC 6.2.1 on macOS Sierra
Problem reported by Denis Davydov in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00056.html
* lib/sched.in.h [HAVE_SYS_CDEFS_H]:
Include <sys/cdefs.h> before <sched.h>.
* m4/nproc.m4 (gl_PREREQ_NPROC): Include errno.h before sched.h,
so that we needn’t worry about the sched.h include bug here.
* m4/sched_h.m4 (gl_SCHED_H): Check for sys/cdefs.h,
and include it before <sched.h> if it exists, when
checking for <sched.h>.
Paul Eggert [Sun, 25 Sep 2016 03:13:43 +0000 (20:13 -0700)]
tests/init.sh: port Alpine fix to AIX 7.1
* tests/init.sh (compare_): When attempting to use diff -U3,
prefer diff -u to -U3 to -c to plain diff. Do not insist on
Paul Eggert [Thu, 22 Sep 2016 21:42:15 +0000 (14:42 -0700)]
nl_langinfo: pacify GCC
* lib/nl_langinfo.c (ctype_codeset): Remove unused local.
(rpl_nl_langinfo): Cast string literals to char *, to pacify GCC.
Paul Eggert [Thu, 22 Sep 2016 18:44:39 +0000 (11:44 -0700)]
stdint: also set GL_GENERATE_LIMITS_H
Problem reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00052.html
* m4/stdint.m4 (gl_STDINT_H): Also redo the AM_CONDITIONAL.
Paul Eggert [Thu, 22 Sep 2016 17:47:57 +0000 (10:47 -0700)]
limits-h, stdint: Don't assume extensions, fix typo
* m4/limits-h.m4 (gl_LIMITS_H):
* m4/stdint.m4 (gl_STDINT_H):
Don't assume AC_USE_SYSTEM_EXTENSIONS.
* m4/stdint.m4 (gl_STDINT_H): Fix typo in setting of LIMITS_H,
reported by Jim Meyering in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-09/msg00050.html
Jim Meyering [Thu, 22 Sep 2016 04:15:59 +0000 (21:15 -0700)]
getprogname: port to AIX
* lib/getprogname.c (getprogname) [_AIX]: Use getpid, getprocs64
and strdup to obtain a short program name string. Using code from
Bruno Haible and an idea from Bastien ROUCARIÈS, in
https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00249.html
Assaf Gordon reported that this new file would fail to compile on
AIX-7.1 32bit.
Karl Berry [Mon, 19 Sep 2016 16:32:31 +0000 (09:32 -0700)]
update from texinfo
Karl Berry [Sun, 18 Sep 2016 16:12:57 +0000 (09:12 -0700)]
update from texinfo
Paul Eggert [Thu, 15 Sep 2016 19:30:25 +0000 (12:30 -0700)]
extensions: fix typo in comment
* m4/extensions.m4: Sync from Autoconf master.
Paul Eggert [Thu, 15 Sep 2016 18:34:52 +0000 (11:34 -0700)]
stdint: support new _WIDTH macros
* doc/posix-headers/stdint.texi: Document this.
* lib/stdint.in.h: Add support for INTMAX_WIDTH. etc.
* m4/stdint.m4 (gl_STDINT_H): Require gl_LIMITS_H. Check for
support for INTMAX_WIDTH, etc. as well as for support for just C99.
* modules/stdint (Depends-on): Add limits-h.
(Makefile.am): Substitute HAVE_C99_STDINT_H.
* modules/stdint-tests (Depends-on): Add extensions, so that
INTMAX_MAX etc. are defined.
* tests/test-stdint.c: Verify the new macros.
Paul Eggert [Thu, 15 Sep 2016 18:34:52 +0000 (11:34 -0700)]
limits-h: new module
This adds ISO/IEC TS 18661-1:2014 support to limits.h.
* MODULES.html.sh: Add limits-h,and move size_max to stdint section.
* doc/posix-headers/limits.texi: Document new module.
* lib/limits.in.h, m4/limits-h.m4, modules/limits-h:
* modules/limit-h-tests, tests/test-limits-h.c: New files.
Paul Eggert [Fri, 16 Sep 2016 07:37:14 +0000 (00:37 -0700)]
stdio: don't redefine __USE_MINGW_ANSI_STDIO
* m4/stdio_h.m4 (gl_STDIO_H): Don't define __USE_MINGW_ANSI_STDIO
if it is already defined. Apparently GNU Emacs relies on this. See:
http://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00416.html