Jim Meyering [Wed, 3 Feb 2016 05:39:44 +0000 (21:39 -0800)]
verify-tests: also remove stray test-verify.Tpo
* modules/verify-tests (Makefile.am): Arrange for "make clean"
to remove the test-verify.Tpo file that is left behind by
the automake-generated rule upon compilation failure.
Otherwise, that .Tpo file would cause a failed "make distcheck"
at least for grep.
Paul Eggert [Tue, 2 Feb 2016 22:29:53 +0000 (14:29 -0800)]
std-gnu11: new module
This makes it easier for applications to prefer C11 and C++11
to older variants, when compiling C and C++ code.
Unlike most m4/*.m4 files, m4/std-gnu11.m4 is GPLed, as it copies
a nontrivial chunk of GPLed Autoconf source code.
* COPYING: Mention the m4/*.m4 copyright situation.
* MODULES.html.sh (std-gnu11): New module.
* m4/std-gnu11.m4, modules/std-gnu11: New files.
Daiki Ueno [Mon, 25 Jan 2016 02:07:33 +0000 (11:07 +0900)]
gettext: mark as obsolete
Suggested by Paul Eggert in:
https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00101.html
* modules/gettext (Status): Mark as obsolete.
(Notice): Suggest to use 'gettext-h' instead.
* modules/gettext-h (Description): Suggest GNU gettext, instead of
the 'gettext' module.
Paul Eggert [Sun, 24 Jan 2016 22:24:35 +0000 (14:24 -0800)]
gnulib-tool: don't give up on ln -s so easily
* gnulib-tool (func_ln_s): Don't give up on a later ln -s merely
because an earlier one failed. The targets could be on different
file systems. Problem reported by KO Myung-Hun in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00081.html
Paul Eggert [Sun, 24 Jan 2016 22:13:41 +0000 (14:13 -0800)]
closedir: fix OS/2-related typos
Problem reported by KO Myung-Hun in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00107.html
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Fix a couple of typos
in the last couple of changes.
Paul Eggert [Sun, 24 Jan 2016 08:55:44 +0000 (00:55 -0800)]
regex: treat [x] as x if x is a unibyte encoding error
Problem reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00091.html
* lib/regcomp.c (parse_byte) [!_LIBC && RE_ENABLE_I18N]: New function.
(build_range_exp) [!_LIBC && RE_ENABLE_I18N]: Use it.
Paul Eggert [Sun, 24 Jan 2016 08:28:19 +0000 (00:28 -0800)]
closedir, dirfd, opendir: port to OpenSolaris 5.10
* m4/closedir.m4 (gl_FUNC_CLOSEDIR):
* m4/dirfd.m4 (gl_FUNC_DIRFD):
* m4/opendir.m4 (gl_FUNC_OPENDIR):
Don't use ${word##pat} substitution, as it doesn't work in
OpenSolaris 5.10 /bin/sh. Problem reported by Assaf Gordon in:
http://bugs.gnu.org/22443#11
Daiki Ueno [Tue, 19 Jan 2016 01:15:36 +0000 (10:15 +0900)]
utimens-tests: avoid pulling gettext .m4 files
Although this is not the right fix to the original problem:
http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00086.html
it makes it possible again for consumer projects to use arbitrary
version of gettext, through the steps described at:
http://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html
See here for details:
https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00079.html
* modules/futimens-tests (Depends-on): Add 'gettext-h' in place of
'gettext'.
* modules/utimens-tests (Depends-on): Add 'gettext-h' in place of
'gettext'.
Paul Eggert [Mon, 18 Jan 2016 18:32:26 +0000 (10:32 -0800)]
regex: fix [ diagnostic
Problem and fix reported by Aharon Robbins in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
* lib/regcomp.c (REG_EBRACK_IDX): Fix misleading diagnostic about [.
Pádraig Brady [Mon, 18 Jan 2016 17:29:28 +0000 (17:29 +0000)]
fts: don't unconditionally use leaf optimization for NFS
NFS st_nlink are not accurate on all implementations,
leading to aborts() if that assumption is made.
See <https://bugzilla.redhat.com/1299169>
* lib/fts.c (leaf_optimization_applies): Remove NFS from
the white list, and document the issue.
KO Myung-Hun [Fri, 28 Nov 2014 07:43:14 +0000 (16:43 +0900)]
utimes: detect utimes() correctly on OS/2 kLIBC
utimes() of OS/2 kLIBC has some limitations.
1. OS/2 itself supports a file date since 1980 year in local time.
2. OS/2 itself supports only even seconds for a file time.
3. utimes() of OS/2 kLIBC does not work on an opened file.
* m4/utimes.m4: Detect utimes() correctly on OS/2 kLIBC.
* doc/posix-functions/utimes.texi: Document the above limitations of
utimes() on OS/2 kLIBC.
Paul Eggert [Sat, 17 Jan 2015 09:54:05 +0000 (18:54 +0900)]
openat_proc_name: port to OS/2 kLIBC
OS/2 kLIBC provides a function to retrive a path from a fd. Use it
instead of /proc/self/fd.
* lib/openat-proc.c (openat_proc_name):
Don't assume file name length is less than INT_MAX.
Port to OS/2 kLIBC with __libc_Back_ioFHToPath().
KO Myung-Hun [Fri, 15 Jan 2016 18:06:57 +0000 (10:06 -0800)]
stdint: check _INTPTR_T_DECLARED for intptr_t etc.
OS/2 kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
definitions of intptr_t and uintptr_t (which use int and unsigned)
to avoid clashes with declarations of system functions like sbrk.
* lib/stdint.in.h (intptr_t, uintptr_t): Check
_INTPTR_T_DECLARED before defining them.
KO Myung-Hun [Thu, 14 Jan 2016 02:23:47 +0000 (11:23 +0900)]
dup, dup2, fcntl: support a directory fd on OS/2 kLIBC
On OS/2 kLIBC, dup(), dup2() and fcntl() do not work on a directory
fd.
* lib/dup.c (dup_nothrow): New.
* lib/dup2.c (klibc_dup2dirfd): New. dup2() for a directory fd.
(klibc_dup2): New.
* lib/fcntl.c (klibc_fcntl): New.
* m4/dup.m4 (gl_FUNC_DUP): Check if dup() works on a directory fd.
* m4/dup2.m4 (gl_FUNC_DUP2): Check if dup2() works on a directory fd.
* m4/fcntl.m4 (gl_FUNC_FCNTL): Check if F_DUPFD works on a directory
fd.
KO Myung-Hun [Thu, 14 Jan 2016 02:23:46 +0000 (11:23 +0900)]
pipe_filter_ii_execute: port to OS/2 kLIBC
Pipes on kLIBC do not support O_NONBLOCK like Win32.
* lib/pipe-filter-ii.c (start_wrapper, _beginthreadex, CloseHandle,
WaiForSingleObject, WaitForMultipleObjects): New on OS/2 kLIBC.
Reuse Win32 code on OS/2 kLIBC.
* lib/spawn-pipe.c: Reuse Win32 code on OS/2 kLIBC.
* lib/w32spawn.h: Do not include windows.h on OS/2 kLIBC.
KO Myung-Hun [Thu, 14 Jan 2016 02:23:45 +0000 (11:23 +0900)]
wchar: fix "conflicting types" error for __wcwidth on OS/2 kLIBC
On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
static inline function. The implementation of wcwidth in wcwidth.c
causes a "conflicting types" error.
* lib/wchar.in.h: Undefine wcwidth on OS/2 kLIBC.
Pádraig Brady [Thu, 14 Jan 2016 09:47:39 +0000 (09:47 +0000)]
sig2str: list all signals on FreeBSD >= 7
FreeBSD >= 7 is contravening POSIX by not defining NSIG
to the maximal statically defined signal value.
It does define _SIG_MAXSIG though, so base SIGNUM_BOUND on that.
* lib/sig2str.h (SIGNUM_BOUND): Define to (_SIG_MAXSIG - 2)
where available, even when NSIG is defined.
Paul Eggert [Wed, 13 Jan 2016 19:10:28 +0000 (11:10 -0800)]
acl-permissions: port to USE_ACL==0 platforms
I ran into this problem when building bleeding-edge GNU Emacs
with gcc -fsanitize=address on Fedora 23. On this platform
the ACL library does not pass the 'configure' test and Emacs
then does not build due in part to what appear to be typos in the
ACL part of Gnulib.
* lib/acl-internal.c (free_permission_context):
* lib/acl-internal.h (struct permission_context):
Test whether USE_ACL is nonzero, not whether it is defined.
Paul Eggert [Tue, 12 Jan 2016 23:20:39 +0000 (15:20 -0800)]
Port "$@" to OpenIndiana ksh93
In http://lists.gnu.org/archive/html/bug-autoconf/2015-12/msg00000.html
Pavel Raiskup reports that ${1+"$@"} runs afoul of a bug in /bin/sh
(derived from ksh 93t+ 2010-03-05). ${1+"$@"} works around an ancient
bug long-dead shells, so remove the workaround.
* build-aux/announce-gen, build-aux/do-release-commit-and-tag:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/prefix-gnulib-mk, build-aux/update-copyright:
* build-aux/useless-if-before-free, tests/test-update-copyright.sh:
Use "$@" instead of ${1+"$@"}.
Paul Eggert [Tue, 12 Jan 2016 17:29:40 +0000 (09:29 -0800)]
Port Universal Time settings to strict POSIX
* build-aux/announce-gen, build-aux/bootstrap:
* build-aux/do-release-commit-and-tag, build-aux/git-version-gen:
* build-aux/gitlog-to-changelog, build-aux/gnu-web-doc-update:
* build-aux/gnupload, build-aux/mkinstalldirs:
* build-aux/move-if-change, build-aux/prefix-gnulib-mk:
* build-aux/update-copyright, build-aux/useless-if-before-free:
* build-aux/vc-list-files, tests/test-strftime.c:
Use TZ="UTC0", not TZ="UTC". Either works on GNU platforms,
but POSIX says the behavior of TZ="UTC" is undefined.
Paul Eggert [Sun, 3 Jan 2016 00:19:53 +0000 (16:19 -0800)]
msvc-inval: fix problem with unset shell var
Problem reported by Karl Berry in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00004.html
* modules/msvc-inval (Depends-on):
AC_REQUIRE gl_MSVC_INVAL instead of merely calling it.
* modules/msvc-nothrow (Depends-on): Likewise for gl_MSVC_NOTHROW.
Paul Eggert [Fri, 1 Jan 2016 08:56:19 +0000 (00:56 -0800)]
version-etc: new year
* build-aux/gendocs.sh (version):
* doc/gendocs_template:
* doc/gendocs_template_min:
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR):
Update copyright dates by hand in templates and the like.
* all files: Run 'make update-copyright'.
Daiki Ueno [Sun, 27 Dec 2015 21:27:42 +0000 (06:27 +0900)]
maint: fix operator precedence in mbrtowc test
This is a fix for test breakage introduced by commit 45228d96; the
equality expression must be parenthesized when negated with '!',
otherwise we always get:
James Youngman [Wed, 23 Dec 2015 19:22:40 +0000 (19:22 +0000)]
regexprops-generic: update from regex.h
* doc/regexprops-generic.texi: update by running the regexprops binary
from findutils (the command line is 'regexprops "Regular Expressions"
generic'). The recent (ish) change (5a5a9388) to regex.h aligning
gnulib with GNU grep had made this document out-of-date.
Pádraig Brady [Tue, 22 Dec 2015 15:45:56 +0000 (15:45 +0000)]
strftime-tests: avoid false failure on OS X
* tests/test-strftime.c (struct localtime_rz_test): Add an
ahistorical member which is used to warn rather than fail
when tm_isdst isn't set for such entries. This is the case for
"1970-01-01 13:00:00 +1300 (NZDT)" on Darwin 13/14 at least.
Kamil Dudka [Wed, 9 Dec 2015 06:34:56 +0000 (07:34 +0100)]
fts: ensure leaf optimization is used for NFS
NFS provides usable dirent.d_type but not necessarily for all entries
of large directories. See <https://bugzilla.redhat.com/1252549>
* lib/fts.c (leaf_optimization_applies): Append NFS on the white list.
* build-aux/prefix-gnulib-mk (prefix_assignment): Don't change the RHS
of 'V_GPERF.* = ' lines. Reported by Assaf Gordon in:
https://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00015.html
Paul Eggert [Thu, 17 Dec 2015 20:56:55 +0000 (12:56 -0800)]
intprops-test: work around GCC bug 68971
Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00011.html
* tests/test-intprops.c: Ignore -Woverflow in GCC 6 and earlier.
(main): Add a case that better tests 64-bit long in this area.
Pavel Raiskup [Sat, 21 Nov 2015 13:09:15 +0000 (14:09 +0100)]
gnulib-tool: allow multiple --local-dir usage
* gnulib-tool: Use --local-dir to construct compound
$local_gnulib_path path instead of $local_gnulib_dir. Determine
PATH_SEPARATOR early.
(local_gnulib_dir): Rename into $local_gnulib_path everywhere.
(func_gnulib_dir): Cut out PATH_SEPARATOR detection code into
func_determine_path_separator because that needs to be detected
earlier now.
(func_determine_path_separator): New function.
(func_path_foreach, func_path_foreach_inner): New functions.
(func_path_prepend, func_path_append): Likewise.
(func_lookup_local_file, func_lookup_local_file_cb): Likewise.
(func_lookup_file, func_all_modules): Use new functions to work
with local_gnulib_path.
(func_modules_in_dir, func_exists_module): New callbacks for
func_path_foreach.
(func_exists_module, func_get_tests_module): Likewise.
(func_is_local_file, func_should_symlink): New helper methods.
(func_add_file, func_update_file): Use new func_should_symlink
instead, DRY.
(func_reconstruct_cached_local_gnulib_path): New helper.
(func_reconstruct_cached_dir): New callback.
(func_import): The cached_local_gnulib_dir renamed to
cached_local_gnulib_path similarly to local_gnulib_dir.
Use new func_reconstruct_cached_local_gnulib_path.
(func_count_relative_local_gnulib_path): New sub-method.
(func_create_testdir): Use func_should_symlink, DRY.
(func_create_megatestdir): Use new functions to work with
local_gnulib_path correctly.
(func_append_local_dir): New helper.
Paul Eggert [Tue, 10 Nov 2015 20:31:38 +0000 (12:31 -0800)]
intprops: new public macro EXPR_SIGNED
Emacs can use this macro, so make it public.
* doc/intprops.texi (Arithmetic Type Properties): Rename from
'Integer Type Determination', since some of these macros apply
to non-integer types. Clarify what kinds of constant expressions
these macros return. Say when the arguments can be non-integers.
Mention newly published macro EXPR_SIGNED.
* lib/intprops.h (EXPR_SIGNED): Rename from _GL_INT_SIGNED, to
make it public. All uses changed.
Paul Eggert [Fri, 6 Nov 2015 01:41:43 +0000 (17:41 -0800)]
timespec-sub: fix overflow bug; add tests
* lib/timespec-add.c (timespec_add):
* lib/timespec-sub.c (timespec_sub):
Work even if time_t is narrower than int (a theoretical
possibility). Redo code for a bit more clarity.
* lib/timespec-sub.c (timespec_sub):
Fix off-by-2 bug if a.tv_sec == TYPE_MINIMUM (time_t) and 0 < b.tv_sec.
* modules/timespec-tests, tests/test-timespec.c: New files.
Paul Eggert [Thu, 5 Nov 2015 15:46:32 +0000 (07:46 -0800)]
intprops-test: suppress -Woverlength-strings
Problem reported by Pádraig Brady in:
http://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00008.html
It is not worth the hassle to port this test to compilers that
cannot handle long strings in diagnostics.
* tests/test-intprops.c [__GNUC__]: Ignore -Woverlength-strings.
Pádraig Brady [Wed, 4 Nov 2015 23:01:25 +0000 (23:01 +0000)]
quotearg: add quotearg_n_style_colon()
This quotes with default options of the specified style,
but with quoting enabled for instances of ':'.
While this can be simulated by temporarily modifying
the default quoting style, this is a little awkward,
and care must be taken with such an implementation
to avoid inlining leading to bloated text.
* lib/quotearg.h (quotearg_n_style_colon): Description and declaration.
* lib/quotearg.c (quotearg_n_style_colon): New function implementation.
Paul Eggert [Wed, 4 Nov 2015 16:27:57 +0000 (08:27 -0800)]
intprops: revise _WRAPV macros, revert _OVERFLOW
The incompatible changes to the _OVERFLOW macros were too much of
a hassle in practice, so revert them. Instead, change the new
_WRAPV macros to make them closer in behavior to GCC 5's new
builtin_add_overflow etc. functions. No other software was using
these newly-added macros yet, so this should be OK.
* NEWS: Revert previous change, since the incompatible change
has been reverted, and nobody used the incompatible version.
* doc/intprops.texi (Wraparound Arithmetic, Integer Type Overflow):
Document revised behavior.
(Integer Range Overflow): Adjust example to match above revisions.
* lib/intprops.h (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW)
(INT_MULTIPLY_OVERFLOW): Revert previous change, so that
these can be used in integer constant expressions again.
(INT_CONST_ADD_OVERFLOW, INT_CONST_SUBTRACT_OVERFLOW)
(INT_CONST_MULTIPLY_OVERFLOW): Remove, as these are no longer
needed.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, INT_LEFT_SHIFT_WRAPV):
Remove, as they did not seem that useful.
(INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV)
(_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH)
(_GL_INT_OP_WRAPV_VIA_UNSIGNED):
Support new semantics.
(__has_builtin): New macro, if not alreay defined.
(_GL__GENERIC_BOGUS, _GL_INT_OP_CALC, _GL_INT_OP_CALC1): New macros.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): Remove.
(CHECK_SBINOP, CHECK_SSUM, CHECK_SUM1, CHECK_SSUM1)
(CHECK_SDIFFERENCE, CHECK_SPRODUCT, CHECK_PRODUCT1, CHECK_SPRODUCT1):
New macros.
(CHECK_BINOP, CHECK_UNOP, main, CHECK_SUM): Test new behavior.
Jim Meyering [Tue, 3 Nov 2015 16:32:27 +0000 (08:32 -0800)]
intprops: add parentheses for when OP has precedence lower than "-"
* lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): In "a OP b - c",
"a OP b" must be parenthesized for when OP is like "<<", which has
lower precedence than the following "-". Reported by Pádraig Brady.
Pádraig Brady [Fri, 30 Oct 2015 22:49:16 +0000 (22:49 +0000)]
quotearg: add support for $'' shell escaping
* lib/quotearg.h: Add "shell-escape" and "shell-escape-always"
items and descriptions.
* lib/quotearg.c (quotearg_buffer_restyled): Add support for the
above types by quoting like "shell", but using $'...' syntax
for non printable characters, which should provide unambiguous
printable output for any input.
* tests/test-quotearg-simple.c: Update accordingly.
Pádraig Brady [Mon, 2 Nov 2015 11:25:47 +0000 (11:25 +0000)]
maint: use a more standard return from mbrtowc test
* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Don't return 1
from the test program as this is non standard and often
indicates an unhandled case in the test program.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): Likewise.
Paul Eggert [Fri, 30 Oct 2015 20:45:26 +0000 (13:45 -0700)]
intprops: add WRAPV and const flavors for GCC 5
If available, use GCC 5's builtin functions for efficient integer
overflow checking. Also, add macros like INT_ADD_WRAPV that efficently
and safely compute the low-order bits of the correct answer.
A downside of these efficient functions is that they cannot be
used in constant expressions, so add macros like INT_CONST_ADD_OVERFLOW
and INT_CONST_ADD_WRAPV that can be used even in constant expressions.
* NEWS: Document the incompatible changes to INT_ADD_OVERFLOW etc.
* doc/intprops.texi (Integer Properties, Integer Type Overflow):
Document the changes.
(Wraparound Arithmetic): New section.
(Integer Range Overflow):
Put this subsection last, since it's least useful.
* lib/intprops.h (INT_CONST_ADD_OVERFLOW)
(INT_CONST_SUBTRACT_OVERFLOW, INT_CONST_MULTIPLY_OVERFLOW):
New macros, with the meaning that INT_ADD_OVERFLOW etc. used to have.
(INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV)
(INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV)
(INT_REMAINDER_WRAPV, _GL_INT_OP_WRAPV, _GL_EXPR_CAST)
(_GL_INT_OP_WRAPV_LONGISH, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV)
(INT_MULTIPLY_WRAPV, _GL_OP_OVERFLOW, _GL_OP_WRAPV, _GL_OP_WRAPV_GENSYM):
New macros.
(INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW, INT_MULTIPLY_OVERFLOW):
Generate calls to GCC builtins if available, for speed.
* tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW)
(INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW)
(INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV)
(INT_CONST_LEFT_SHIFT_WRAPV): New macros.
(main, CHECK_BINOP, CHECK_UNOP, CHECK_SUM, CHECK_PRODUCT)
(CHECK_QUOTIENT, CHECK_REMAINDER):
Test WRAPV and CONST flavors (when available) too.
Pádraig Brady [Fri, 23 Oct 2015 02:15:40 +0000 (03:15 +0100)]
doc: use extended timezone format in iso-8601 example
* doc/parse-datetime.texi: The standard states that extended
format (separated with ':') is to be used consistently throughout.
Note that lib/parse-datetime.y can handle either tz format.