Paul Eggert [Mon, 14 Mar 2016 20:17:06 +0000 (13:17 -0700)]
select: try to port to 2016.1.150 compiler
Problem reported by Balázs Hajgató in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00026.html
* lib/sys_select.in.h (select): Use 'restrict' on arguments where
POSIX specifies 'restrict'.
Paul Eggert [Mon, 14 Mar 2016 05:44:58 +0000 (22:44 -0700)]
localename-tests: memory allocation fixes
* tests/test-localename.c (test_locale_name)
(test_locale_name_thread): Don't call freelocale on a locale
that was the base of a successful newlocale, as that
results in a double free. Problem reported by Assaf Gordon.
(test_locale_name_thread): Free saved names after use, to pacify
gcc -fsanitize=address.
Paul Eggert [Wed, 9 Mar 2016 00:35:58 +0000 (16:35 -0800)]
intprops: make .h file license match module
* lib/intprops.h: Change the license wording to match glibc format.
This is what is in modules/intprops anyway. See:
https://sourceware.org/bugzilla/show_bug.cgi?id=19738#c8
Eric Blake [Tue, 8 Mar 2016 22:35:30 +0000 (15:35 -0700)]
acl: fix missing return on Cygwin
Compilation on Cygwin 2.4.1 resulted in an 'install' that behaved
differently depending on compile-time flags; I traced it to this
warning, where the difference was based on what was left in the
return register:
lib/set-permissions.c: In function 'set_acls_from_mode':
lib/set-permissions.c:273:1: warning: control reaches end of non-void
function [-Wreturn-type]
* lib/set-permissions.c (set_acls) [HAVE_FACL && GETACL]: Don't
fall off end of function. Fixes http://bugs.gnu.org/22949
Bruno Haible [Sat, 5 Mar 2016 00:38:45 +0000 (01:38 +0100)]
extern-inline: port to PGI CC
* m4/extern-inline.m4 (gl_EXTERN_INLINE): For PGI CC, don't use the
keyword 'inline'.
Reported by Adam James Stewart in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00006.html
Paul Eggert [Sat, 20 Feb 2016 15:52:53 +0000 (07:52 -0800)]
signbit: port back to pre-C++11 GCC
* lib/math.in.h (signbit): Do previous change only if
__cplusplus < 201103. See Jonathan Wakely in:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/UY3VX3W7XEXYTUKHG5BALU4ACUD7ZLGE/
Kamil Dudka [Fri, 19 Feb 2016 09:41:49 +0000 (10:41 +0100)]
mountlist: recognize autofs-mounted remote file systems, too
Originally reported at: https://bugzilla.redhat.com/1309247
* lib/mountlist.c (ME_REMOTE): Return true if a file system is named
"-hosts" because it is used by autofs to mount remote file systems.
Paul Eggert [Sat, 20 Feb 2016 01:07:48 +0000 (17:07 -0800)]
signbit: port to C++ with GCC 6
* lib/math.in.h (signbit) [__cplusplus]:
Do not replace with GCC builtin. Reported by Orion Poplawski in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-02/msg00005.html
Paul Eggert [Fri, 19 Feb 2016 17:27:41 +0000 (09:27 -0800)]
regex: make it closer to libc
Make Idx a signed type, rather than possibly unsigned.
The unsignedness was not really buying us anything, since the code
overflows for other reasons before getting to PTRDIFF_MAX. Making
it signed allows us to use -1 and -2 with abandon, like libc does,
thus lessening the number of differences between gnulib and libc.
Also, it should help avoid gratuitous warnings like the one
reported by Nelson H. F. Beebe in: http://bugs.gnu.org/22702
* lib/regex.h (__re_idx_t): Remove. All uses changed to regoff_t.
* lib/regex_internal.h (SSIZE_MAX): Define if <limits.h> doesn't.
(IDX_MAX) [_REGEX_LARGE_OFFSETS]: Now SSIZE_MAX.
(REG_MISSING, REG_ERROR, REG_VALID_INDEX, REG_VALID_NONZERO_INDEX):
Remove. Revert all uses to their libc versions.
Paul Eggert [Wed, 10 Feb 2016 22:56:32 +0000 (14:56 -0800)]
stdalign: port to older HP and IBM cc
* lib/stdalign.in.h (_Alignas): Port better to older HP and IBM
C compilers, by checking their version numbers. These version
numbers appear in MariaDB and in Qt code that dates way back and
that conditiionally uses the 'aligned' attribute.
Paul Eggert [Tue, 9 Feb 2016 16:54:11 +0000 (08:54 -0800)]
stdalign: port to clang 3.7.0
Problem reported by Herbert J. Skuhra in:
http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00476.html
* lib/stdalign.in.h (alignas): Fix typo that prevented 'alignas'
from being defined on clang 3.7.0, which has a buggy stdalign.h. See:
https://llvm.org/bugs/show_bug.cgi?id=26547
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.