Bruno Haible [Fri, 16 Mar 2018 15:25:02 +0000 (16:25 +0100)]
glob: Don't compile replacements on recent glibc systems.
* lib/glob.in.h: Use the usual idiom for the double-inclusion guard. If
REPLACE_GLOB is 0, include the system's <glob.h> and use
_GL_CXXALIAS_SYS.
* m4/glob.m4 (gl_GLOB): Set REPLACE_GLOB instead of GLOB_H. Accept
_GNU_GLOB_INTERFACE_VERSION 2 as well. Delete the file conf$$-globtest
inside the AC_RUN_IFELSE block. Remove GL_GENERATE_GLOB_H conditional.
* modules/glob (Dependencies): Test REPLACE_GLOB instead of GLOB_H.
Remove snippet/warn-on-use.
(configure.ac): Test REPLACE_GLOB instead of GLOB_H.
(Makefile.am): Create glob.h always. Update list of substitutions in
glob.h. Don't depend on $(WARN_ON_USE_H).
Bruno Haible [Thu, 15 Mar 2018 21:26:09 +0000 (22:26 +0100)]
host-cpu-c-abi: Support for RISC-V CPU.
* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Recognize the various
riscv32 and riscv64 ABIs.
References:
https://github.com/riscv/riscv-toolchain-conventions
https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/RISC-V-Options.html
https://gnu-mcu-eclipse.github.io/toolchain/riscv/
Paul Eggert [Wed, 7 Mar 2018 08:29:38 +0000 (00:29 -0800)]
maint: write-file-hooks -> before-save-hook
write-file-hooks is obsolete since Emacs 22.1 (released June 2007) and
it's time to use the recommended replacement.
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00008.html
* build-aux/announce-gen, build-aux/bootstrap:
* build-aux/do-release-commit-and-tag, build-aux/gendocs.sh:
* build-aux/git-version-gen, build-aux/gitlog-to-changelog:
* build-aux/gnu-web-doc-update, build-aux/gnupload:
* 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:
Update hook usage for files where Gnulib is the canonical source.
Paul Eggert [Mon, 5 Mar 2018 23:30:56 +0000 (15:30 -0800)]
binary-io: pacify gcc -Wunused-parameter
Problem reported by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00005.html
* lib/binary-io.h (__gl_setmode, __gl_setmode_check):
Use _GL_UNUSED where appropriate.
Paul Eggert [Tue, 27 Feb 2018 17:04:42 +0000 (09:04 -0800)]
environ: fix link error on 32-bit Cygwin
Problem reported for GNU Emacs by Ken Brown in:
https://lists.gnu.org/r/emacs-devel/2018-02/msg00765.html
* lib/unistd.in.h (environ) [__i386__]: Do not redeclare.
Bruno Haible [Sat, 24 Feb 2018 11:59:59 +0000 (12:59 +0100)]
localename: Add support for musl libc.
* m4/localename.m4 (gl_LOCALENAME): Check for <langinfo.h>.
* lib/localename.c (gl_locale_name_thread_unsafe): Use NL_LOCALE_NAME
on Linux platforms which define NL_LOCALE_NAME.
Paul Eggert [Fri, 23 Feb 2018 21:15:24 +0000 (13:15 -0800)]
nl_langinfo: pacify gcc -Wunused-function
* lib/nl_langinfo.c (ctype_codeset): Do not define if
REPLACE_NL_LANGINFO && !GNULIB_defined_CODESET, as it is unused in
this case. Without this change, I got a diagnostic when building
coreutils on Fedora 27 with gcc 7.3.1 20180130.
Paul Eggert [Fri, 23 Feb 2018 20:47:38 +0000 (12:47 -0800)]
malloca: pacify gcc -Wbad-function-cast
* lib/malloca.h (malloca): Pacify gcc -Wbad-function-cast
diagnostic that I got on Fedora 27 with gcc 7.3.1 20180130.
To pacify GCC, I had to cast alloca’s result to some type other
than void * before casting that to uintptr_t.
Paul Eggert [Tue, 20 Feb 2018 17:06:51 +0000 (09:06 -0800)]
utimecmp: new function utimecmpat
* lib/utimecmp.c: Include fcntl.h, sys/stat.h and dirname.h.
Do not include utimens.h.
(utimecmpat): New function, generalizing utimecmp.
(utimecmp): Now a thin layer around utimecmpat.
* modules/utimecmp (Depends-on): Depend on dirname-lgpl, fstatat,
utimensat instead of on lstat and utimens.
Paul Eggert [Tue, 20 Feb 2018 17:05:48 +0000 (09:05 -0800)]
same: new function same_nameat
* lib/same.c: Include fcntl.h.
* lib/same.c (same_nameat): New function, generalizing same_name.
(same_name): Now a thin layer around same_nameat.
* m4/same.m4 (gl_SAME): Check for fpathconf, not pathconf.
* modules/same (Depends-on): Depend on fstatat, openat.
Bruno Haible [Sat, 17 Feb 2018 08:55:43 +0000 (09:55 +0100)]
thread: Fix compilation error on IRIX.
* lib/glthread/thread.h: Include <unistd.h>. Include <signal.h> when
needed; include it outside the C++ extern "C" {} block.
* doc/posix-headers/pthread.texi: Mention the problem with
pthread_atfork on IRIX.
Bruno Haible [Sun, 4 Feb 2018 09:42:45 +0000 (10:42 +0100)]
signal-h, monetary, strings: Fix build failure in some cases.
Reported by Tim Rühsen <tim.ruehsen@gmx.de>.
* modules/signal-h (Makefile.am): In the GNULIB_* substitutions, use '/'
as delimiter in sed command, not '|'.
* modules/monetary (Makefile.am): Likewise.
* modules/strings (Makefile.am): Likewise.
Bruno Haible [Sat, 3 Feb 2018 13:05:45 +0000 (14:05 +0100)]
stdlib: Fix compilation error on OpenIndiana.
* lib/stdlib.in.h: Before including <sys/loadavg.h>, include
<sys/time.h>.
* m4/stdlib_h.m4 (gl_STDLIB_H): Likewise.
* m4/getloadavg.m4 (gl_GETLOADAVG): Likewise.
Bruno Haible [Sat, 3 Feb 2018 11:50:17 +0000 (12:50 +0100)]
host-cpu-c-abi: Avoid use of 'grep -E' on OpenIndiana.
* m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX): Require AC_PROG_EGREP,
and use $EGREP instead of 'grep -E'.
* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Use 'grep' instead of
'grep -E'.
Bruno Haible [Fri, 2 Feb 2018 18:32:02 +0000 (19:32 +0100)]
malloca, xmalloca: Make multithread-safe.
Reported by Florian Weimer <fweimer@redhat.com>.
Implements an idea by Ondřej Bílka <neleai@seznam.cz>.
* lib/malloca.h (malloca): In the stack allocation case, return a
pointer that is a multiple of 2 * sa_alignment_max.
(sa_increment): Remove enum item.
* lib/xmalloca.h (xmalloca): In the stack allocation case, return
a pointer that is a multiple of 2 * sa_alignment_max.
* lib/malloca.c (NO_SANITIZE_MEMORY): Remove macro.
(MAGIC_NUMBER, MAGIC_SIZE, preliminary_header, HEADER_SIZE, header,
HASH_TABLE_SIZE, mmalloca_results): Remove.
(small_t): New type.
(mmalloca, free): Rewritten.
* lib/malloca.valgrind: Remove file.
* modules/malloca (Files): Remove it.
(Depends-on): Remove verify.
Bruno Haible [Wed, 31 Jan 2018 08:04:52 +0000 (09:04 +0100)]
environ: Fix link error on 64-bit Cygwin.
* lib/unistd.in.h (environ): On Cygwin, redeclare with the
__declspec(dllimport) attribute.
* doc/posix-functions/environ.texi: Mention the Cygwin problem.
Bruno Haible [Sat, 27 Jan 2018 07:52:31 +0000 (08:52 +0100)]
getsockname tests: More tests.
* tests/test-getsockname.c (open_server_socket): New function, mostly
copied from test-poll.c.
(main): Check that getsockname fills in addr.
* modules/getsockname-tests (Depends-on): Add the necessary
dependencies.
(test_getsockname_LDADD): Link with $(INET_PTON_LIB).
Paul Eggert [Tue, 23 Jan 2018 08:42:04 +0000 (00:42 -0800)]
Merge strftime.c changes from glibc
This incorporates:
2017-11-14 [BZ #10871] Implement alternative month names
2017-11-14 [BZ #10871] Abbreviated alternative month names (%Ob)
2017-06-20 Use locale_t, not __locale_t, throughout glibc
* lib/nstrftime.c (ABALTMON_1) [!COMPILE_WIDE]: New macro.
(LOCALE_PARAM) [_LIBC && USE_IN_EXTENDED_LOCALE_MODEL]:
Use locale_t, not __locale_t.
(a_altmonth, f_altmonth, aam_len) [_NL_CURRENT]: New macros.
(__strftime_internal): Add support for alternate months.
Paul Eggert [Sun, 14 Jan 2018 21:27:20 +0000 (13:27 -0800)]
filenamecat: make base a suffix of result
* lib/filenamecat-lgpl.c (longest_relative_suffix): Remove.
(mfile_name_concat): Always make BASE a suffix of the result, as
cp expects this. To implement this, separate with '.' instead of
'/' in some rare cases. Clarify spec to say ./BASE not BASE.
* tests/test-filenamecat.c (main): Adjust tests to match
current behavior. Check that BASE_IN_RESULT points to
a copy of BASE and is a suffix of the resultk, and that DIR
is a prefix of the result that is no longer than the prefix
indicated by BASE_IN_RESULT.
To determine the file list that need the marker, I used the command:
for f in `find . -type f | grep -v '^\./\.git/' | grep -v '^\./tests/'`; do
if iconv -f ASCII -t ASCII < $f > /dev/null 2>&1 ; then : ; else
if iconv -f UTF-8 -t UTF-8 < $f > /dev/null 2>&1 ; then
if grep 'The GNU C Library is' $f > /dev/null; then :; else
if grep 'coding: utf-8' $f > /dev/null; then :; else
echo $f
fi
fi
fi
fi
done | LC_ALL=C sort
Paul Eggert [Wed, 3 Jan 2018 21:29:49 +0000 (13:29 -0800)]
test-framework-sh: ‘ps -ef’, not ‘ps ef’
* tests/init.sh (rand_bytes_): Put ‘-’ before new-style ps options.
Suggested by Bob Proulx (Bug#29968).
* build-aux/mktempd (rand_bytes): Make it like tests/init.sh.
Eric Blake [Tue, 2 Jan 2018 21:49:27 +0000 (15:49 -0600)]
stat-time: silence -Wunused-parameter regression
Commit 2c5d5587 causes warnings on non-Sun systems when compiled
under -Wunused-parameter; we've previously tweaked code in commit 81eb8486 to avoid such warnings. Prefer an attribute rather than
a cast to void (the attribute is always okay to apply; gcc
interprets it as 'may be unused', not 'must not be used', precisely
to cater to #if chains where determining whether or not the
parameter is used gets hairy).
* lib/stat-time.h (get_stat_birthtime_ns, get_stat_birthtime):
Prefer attribute over cast-to-void.
(stat_time_normalize): Mark st as potentially unused.
Paul Eggert [Wed, 3 Jan 2018 03:05:05 +0000 (19:05 -0800)]
test-framework-sh: avoid netstat
Problem reported by Kristýna Streitová (Bug#29947).
* tests/init.sh (rand_bytes_): Stop using netstat, as it's
deprecated on SuSE and it's not that important anyway.
Jim Meyering [Tue, 2 Jan 2018 00:12:39 +0000 (16:12 -0800)]
update-copyright: add code to handle more special cases
After running "make update-copyright" this year, five files
required additional manual changes. Automate those adjustments
for next year.
* Makefile (_year_and_prev): Define.
(update-copyright): Add perl commands to induce this year's post-
update-copyright adjustments.
Paul Eggert [Mon, 1 Jan 2018 00:57:25 +0000 (00:57 +0000)]
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.
Paul Eggert [Tue, 19 Dec 2017 23:53:47 +0000 (15:53 -0800)]
regex: use re_malloc etc. consistently
Problem and original patch reported by Arnold Robbins in:
https://sourceware.org/ml/libc-alpha/2017-12/msg00241.html
* lib/regcomp.c (re_comp):
* lib/regexec.c (push_fail_stack, build_trtable, match_ctx_clean):
Use re_malloc/re_realloc/re_free instead of malloc/realloc/free.
Reuben Thomas [Mon, 11 Dec 2017 10:27:52 +0000 (10:27 +0000)]
doc: Improve explanation of supporting relocatable libraries.
* doc/relocatable-maint.texi (Supporting Relocation): Explain
properly how to build the relocatable module for
libraries. (Method and example code from Bruno Haible.)