]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agoget-rusage-as: Make more robust in multithreaded applications.
Bruno Haible [Wed, 27 May 2020 17:40:08 +0000 (19:40 +0200)]
get-rusage-as: Make more robust in multithreaded applications.

* lib/get-rusage-as.c (get_rusage_as_via_setrlimit): Pass an O_CLOEXEC
flag to open().
* modules/get-rusage-as (Depends-on): Add 'open'.

4 years agocrypto/gc: Make more robust in multithreaded applications.
Bruno Haible [Wed, 27 May 2020 17:38:36 +0000 (19:38 +0200)]
crypto/gc: Make more robust in multithreaded applications.

* lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open().
* modules/crypto/gc (Depends-on): Add 'open'.

4 years agocopy-file: Make more robust in multithreaded applications.
Bruno Haible [Wed, 27 May 2020 17:36:54 +0000 (19:36 +0200)]
copy-file: Make more robust in multithreaded applications.

* lib/copy-file.c (qcopy_file_preserving): Pass an O_CLOEXEC flag to
open().

4 years agochown: Make more robust in multithreaded applications.
Bruno Haible [Wed, 27 May 2020 17:35:28 +0000 (19:35 +0200)]
chown: Make more robust in multithreaded applications.

* lib/chown.c (rpl_chown): Pass an O_CLOEXEC flag to open().

4 years agodoc: Fix statement about O_CLOEXEC (wrong since 2017-08-14).
Bruno Haible [Wed, 27 May 2020 18:33:28 +0000 (20:33 +0200)]
doc: Fix statement about O_CLOEXEC (wrong since 2017-08-14).

* doc/posix-headers/fcntl.texi: Gnulib no longer defines O_CLOEXEC to 0.

4 years agofopen-gnu: make 'b' flag can be used with 'e' on Windows
Daiki Ueno [Thu, 28 May 2020 09:40:49 +0000 (11:40 +0200)]
fopen-gnu: make 'b' flag can be used with 'e' on Windows

* lib/fopen.c (rpl_fopen): Pass O_BINARY to open, if a 'b' flag is
specified on Windows.
* tests/test-fopen-gnu.c (DATA): New define.
(main): Add test for reading binary files with an 'e' flag.

4 years agoDon't assume that UNICODE is not defined.
Bruno Haible [Thu, 28 May 2020 00:31:53 +0000 (02:31 +0200)]
Don't assume that UNICODE is not defined.

Some Windows types, such as TCHAR, LPTSTR, LPCTSTR, are defined
differently if the application defines the macro UNICODE.

Reported by Steve Lhomme <robux4@ycbcr.xyz> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00184.html>.

* lib/link.c (CreateHardLinkFuncType): Use LPCSTR, not LPCTSTR.
* lib/localename.c (enum_locales_fn): Use LPSTR, not LPTSTR.
* lib/stat-w32.c (GetFinalPathNameByHandleFuncType): Likewise.

4 years agoImprove pattern for defining _WIN32_WINNT.
Bruno Haible [Thu, 28 May 2020 00:06:51 +0000 (02:06 +0200)]
Improve pattern for defining _WIN32_WINNT.

Newer versions of the Windows API may not only add, but also remove API
functions. Therefore, when the user is e.g. building for Windows 10, we
should not set _WIN32_WINNT to e.g. Windows 8, as this may enable the
use of APIs that were present in Windows 8 but removed in Windows 10.

Suggested by Steve Lhomme <robux4@ycbcr.xyz> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00318.html>.

* lib/ftruncate.c (_WIN32_WINNT): Don't set to a smaller value.
* lib/sethostname.c (_WIN32_WINNT): Likewise.
* lib/stat-w32.c (_WIN32_WINNT): Likewise.

4 years agojavacomp: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 16:05:34 +0000 (18:05 +0200)]
javacomp: Make more robust in multithreaded applications.

* lib/javacomp.c (write_temp_file): Pass an 'e' flag to fopen_temp.
* modules/javacomp (Depends-on): Add fopen-gnu.

4 years agomountlist: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 16:04:26 +0000 (18:04 +0200)]
mountlist: Make more robust in multithreaded applications.

* lib/mountlist.c (setmntent, read_file_system_list): Pass an 'e' flag
to fopen.
* modules/mountlist (Depends-on): Add fopen-gnu.

4 years agosethostname: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 16:00:04 +0000 (18:00 +0200)]
sethostname: Make more robust in multithreaded applications.

* lib/sethostname.c (sethostname): Pass an 'e' flag to fopen.
* modules/sethostname (Depends-on): Add fopen-gnu.

4 years agoreadutmp: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 15:57:58 +0000 (17:57 +0200)]
readutmp: Make more robust in multithreaded applications.

* lib/readutmp.c (read_utmp): Pass an 'e' flag to fopen.
* modules/readutmp (Depends-on): Add fopen-gnu.

4 years agogetpass: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 15:56:31 +0000 (17:56 +0200)]
getpass: Make more robust in multithreaded applications.

* lib/getpass.c (getpass): Pass an 'e' flag to fopen.
* modules/getpass (Depends-on): Add fopen-gnu.

4 years agogetloadavg: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 15:53:47 +0000 (17:53 +0200)]
getloadavg: Make more robust in multithreaded applications.

* lib/getloadavg.c (getloadavg): Pass an 'e' flag to fopen.
* modules/getloadavg (Depends-on): Add fopen-gnu.

4 years agoexclude: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 15:52:23 +0000 (17:52 +0200)]
exclude: Make more robust in multithreaded applications.

* lib/exclude.c (add_exclude_file): Pass an 'e' flag to fopen.
* modules/exclude (Depends-on): Add fopen-gnu.

4 years agobitset: Make more robust in multithreaded applications.
Bruno Haible [Tue, 26 May 2020 15:51:03 +0000 (17:51 +0200)]
bitset: Make more robust in multithreaded applications.

* lib/bitset/stats.c (bitset_stats_read, bitset_stats_write): Pass an
'e' flag to fopen.
* modules/bitset (Depends-on): Add fopen-gnu.

4 years agoread-file: add RF_SENSITIVE flag
Daiki Ueno [Tue, 26 May 2020 08:22:37 +0000 (10:22 +0200)]
read-file: add RF_SENSITIVE flag

* lib/read-file.h (RF_SENSITIVE): New define.
* lib/read-file.c (fread_file, read_file): Take into account of
RF_SENSITIVE flag.
* modules/read-file (Depends-on): Add explicit_bzero.
This adds an alternative behavior of those functions to explicitly
clear the internal memory block when it becomes unused.  This is
useful for reading sensitive information from a file.

4 years agoread-file: add flags to modify reading behavior
Daiki Ueno [Wed, 27 May 2020 06:14:44 +0000 (08:14 +0200)]
read-file: add flags to modify reading behavior

* lib/read-file.h (RF_BINARY): New define.
(fread_file, read_file): Take FLAGS argument.
(read_binary_file): Remove.
* lib/read-file.c (internal_read_file): Merge into ...
(read_file): ... here.
* modules/read-file-tests (Files): Add "tests/macros.h".
* tests/test-read-file.c (main): Refactor using ASSERT macro.
* NEWS: Mention this change.

4 years agodoc/gnulib-intro.texi: add missing "to" in sentence
Bernhard Voelker [Tue, 26 May 2020 21:16:44 +0000 (23:16 +0200)]
doc/gnulib-intro.texi: add missing "to" in sentence

Reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00316.html>.

* doc/gnulib-intro.texi (Collaborative Development): Add "to".

4 years agocount-one-bits: Fix MSVC specific code.
Bruno Haible [Tue, 26 May 2020 20:27:51 +0000 (22:27 +0200)]
count-one-bits: Fix MSVC specific code.

Reported by Gisle Vanem <gisle.vanem@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00309.html>.

* lib/count-one-bits.h (COUNT_ONE_BITS_GENERIC): Don't define if we're
using GCC.
[_MSC_VER]: Use correct syntax for #pragma intrinsic.
(__popcnt64): In 32-bit mode, define as an inline function.
(COUNT_ONE_BITS): Rename first argument to GCC_BUILTIN.

4 years agoargz: Avoid name clashes through argz.h.
Bruno Haible [Tue, 26 May 2020 19:26:13 +0000 (21:26 +0200)]
argz: Avoid name clashes through argz.h.

Reported by Gisle Vanem <gisle.vanem@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00308.html>.

* lib/argz.h: Don't use __ prefixed identifiers.
(const): Remove definition.
(argz_next): Remove inline definitions.

4 years agoread-file: make use of fopen-gnu
Daiki Ueno [Tue, 26 May 2020 05:56:13 +0000 (07:56 +0200)]
read-file: make use of fopen-gnu

* lib/read-file.c (read_file): Pass an 'e' flag to fopen.
(read_binary_file): Likewise.
* modules/read-file (Depends-on): Add fopen-gnu.

4 years agogetentropy, getrandom: new modules
Paul Eggert [Mon, 25 May 2020 16:19:56 +0000 (09:19 -0700)]
getentropy, getrandom: new modules

* MODULES.html.sh (func_all_modules):
* lib/unistd.in.h (getentropy, getrandom):
* m4/unistd_h.m4 (gl_UNISTD_H, gl_UNISTD_H_DEFAULTS):
* modules/unistd (unistd.h):
Add support for getentropy, getrandom.
* doc/glibc-functions/getentropy.texi (getentropy):
* doc/glibc-functions/getrandom.texi (getrandom):
These are now fixed on some platforms.
* lib/getentropy.c, lib/getrandom.c, lib/sys_random.in.h:
* m4/getentropy.m4, m4/getrandom.m4:
* modules/getentropy, modules/getentropy-tests:
* modules/getrandom, modules/getrandom-tests:
* tests/test-getentropy.c, tests/test-getrandom.c:
New files.

4 years agoAdd missing C99 dependencies.
Bruno Haible [Mon, 25 May 2020 06:57:52 +0000 (08:57 +0200)]
Add missing C99 dependencies.

Reported by Paul Smith <psmith@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00290.html>.

* modules/assert (Depends-on): Add c99.
* modules/filenamecat-lgpl (Depends-on): Likewise.
* modules/libc-config (Depends-on): Likewise.
* modules/mktime (Depends-on): Likewise.
* modules/random_r (Depends-on): Likewise.
* modules/regex (Depends-on): Likewise.
* modules/scratch_buffer (Depends-on): Likewise.
* modules/timespec-add (Depends-on): Likewise.
* modules/timespec-sub (Depends-on): Likewise.
* modules/verify (Depends-on): Likewise.

4 years agoexplicit_bzero-tests: pacify -Wmissing-declarations
Paul Eggert [Sun, 24 May 2020 20:51:27 +0000 (13:51 -0700)]
explicit_bzero-tests: pacify -Wmissing-declarations

* tests/test-explicit_bzero.c (do_secret_stuff, test_stack):
Now static.

4 years agofopen-gnu: Add tests.
Bruno Haible [Sun, 24 May 2020 18:40:01 +0000 (20:40 +0200)]
fopen-gnu: Add tests.

* tests/test-fopen-gnu.c: New file.
* modules/fopen-gnu-tests: New file.

4 years agofopen-gnu: New module.
Bruno Haible [Sun, 24 May 2020 18:38:53 +0000 (20:38 +0200)]
fopen-gnu: New module.

Suggested by Tim Rühsen <tim.ruehsen@gmx.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00119.html>.

* lib/fopen.c (rpl_fopen): When the fopen-gnu module is enabled and the
mode contains an 'x' or 'e' flag, use open() followed by fdopen().
* m4/fopen.m4 (gl_FUNC_FOPEN_GNU): New macro.
* modules/fopen-gnu: New file.
* doc/posix-functions/fopen.texi: Document the 'fopen-gnu' module.

4 years agoopen, openat: Really support O_CLOEXEC.
Bruno Haible [Sun, 24 May 2020 18:27:39 +0000 (20:27 +0200)]
open, openat: Really support O_CLOEXEC.

* lib/open.c (open): When have_cloexec is still undecided, do pass a
O_CLOEXEC flag to orig_open.
* lib/openat.c (rpl_openat): When have_cloexec is still undecided, do
pass a O_CLOEXEC flag to orig_openat.
* tests/test-open.h (test_open): Verify that O_CLOEXEC is honoured.
* modules/open-tests (Depends-on): Add fcntl.
* modules/openat-tests (Depends-on): Likewise.
* modules/fcntl-safer-tests (Depends-on): Likewise.

4 years agofopen: Fix the trailing slash workaround.
Bruno Haible [Sun, 24 May 2020 11:57:59 +0000 (13:57 +0200)]
fopen: Fix the trailing slash workaround.

* lib/fopen.c (rpl_fopen): Parse the mode string. Recognize "r+" as a
write access. Pass the right flags to open().
* tests/test-fopen.h (test_fopen): Add a few more tests on directories.

4 years agoassure: new macro ‘affirm’
Paul Eggert [Sun, 24 May 2020 02:06:16 +0000 (19:06 -0700)]
assure: new macro ‘affirm’

* lib/assure.h: Include verify.h.
(affirm): New macro, after a suggestion by Marc Nieper-Wißkirchen in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00263.html
and commentary by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00278.html
* modules/assure (Depends-on:): Add verify.

4 years agocalloc-gnu: Make the test work in non-flat address spaces.
Bruno Haible [Sat, 23 May 2020 21:46:43 +0000 (23:46 +0200)]
calloc-gnu: Make the test work in non-flat address spaces.

Uses code by Paul Eggert.

* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Allow a calloc() implementation
to return more than SIZE_MAX bytes, but only without wrap-around bugs.

4 years agocalloc-gnu: Avoid wrong configure results with GCC's AddressSanitizer.
Bruno Haible [Sat, 23 May 2020 20:13:45 +0000 (22:13 +0200)]
calloc-gnu: Avoid wrong configure results with GCC's AddressSanitizer.

* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Split the AC_RUN_IFELSE into two
AC_RUN_IFELSE invocations.

4 years agoisnanf, isnanl, isnan: Don't use nonexistent builtins with clang.
Bruno Haible [Sat, 23 May 2020 19:17:22 +0000 (21:17 +0200)]
isnanf, isnanl, isnan: Don't use nonexistent builtins with clang.

* m4/isnanf.m4 (gl_HAVE_ISNANF_NO_LIBM, gl_HAVE_ISNANF_IN_LIBM,
gl_ISNANF_WORKS): Don't use __builtin_isnanf on clang versions that
don't have it.
* m4/isnanl.m4 (gl_HAVE_ISNANL_NO_LIBM, gl_HAVE_ISNANL_IN_LIBM,
gl_FUNC_ISNANL_WORKS): Don't use __builtin_isnanl on clang versions that
don't have it.
* lib/isnanf-nolibm.h (__has_builtin): New macro.
(isnanf): Don't use __builtin_isnanf on clang versions that don't have
it.
* lib/isnanl-nolibm.h (__has_builtin): New macro.
(isnanl): Don't use __builtin_isnanl on clang versions that don't have
it.
* lib/math.in.h (__has_builtin): New macro.
(isnanf): Don't use __builtin_isnanf on clang versions that don't have
it.
(isnanl): Don't use __builtin_isnanl on clang versions that don't have
it.
(isnan): Don't use the builtins on clang versions that don't have
__builtin_isnanf and __builtin_isnanl.

4 years agocalloc-gnu: Avoid wrong configure results with clang.
Bruno Haible [Sat, 23 May 2020 18:41:51 +0000 (20:41 +0200)]
calloc-gnu: Avoid wrong configure results with clang.

* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Mark the pointer variable as
'volatile', to defeat compiler optimizations.

4 years agoisnanl, isnanl-nolibm: Make a test work better with "gcc -O2" on x86_64.
Bruno Haible [Sat, 23 May 2020 17:49:42 +0000 (19:49 +0200)]
isnanl, isnanl-nolibm: Make a test work better with "gcc -O2" on x86_64.

* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Pass the
'long double' values by reference, with values taken from a statically
allocated array.

4 years agofindprog-in: Ignore directories.
Bruno Haible [Sat, 23 May 2020 10:19:34 +0000 (12:19 +0200)]
findprog-in: Ignore directories.

Reported by Frederick Eaton via Dmitry Goncharov in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>.

* lib/findprog-in.c (find_in_given_path): When the file found is a
directory, set errno to EACCES and, during a PATH search, continue
searching.
* modules/findprog-in (Depends-on): Add sys_stat, stat.

4 years agoverify: document ‘assume’ better
Paul Eggert [Sat, 23 May 2020 16:41:54 +0000 (09:41 -0700)]
verify: document ‘assume’ better

* lib/verify.h (assume): Say it’s for static analysis, not dynamic.

4 years agoautoupdate
Karl Berry [Sat, 23 May 2020 15:23:03 +0000 (08:23 -0700)]
autoupdate

4 years agogendocs: Clarify licenses for templates.
Asher Gordon [Fri, 22 May 2020 17:39:01 +0000 (13:39 -0400)]
gendocs: Clarify licenses for templates.

* doc/gendocs_template: Add a GNU All-Permissive license notice and
bump Parent-Version.
* doc/gendocs_template_min: Add a GNU All-Permissive license notice
and copy the explanatory comment about the license notice at the
bottom from gendocs_template.

4 years agogroup-member: Relicense under LGPLv2+.
Bruno Haible [Thu, 21 May 2020 19:43:32 +0000 (21:43 +0200)]
group-member: Relicense under LGPLv2+.

Jim Meyering's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00218.html>.
Paul Eggert's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00225.html>.
Eric Blake's approval is in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00217.html>.

* modules/group-member (License): Change to LGPLv2+.

4 years agomemmem: Avoid wrong configure results with "clang -fsanitize=undefined".
Bruno Haible [Thu, 21 May 2020 18:38:39 +0000 (20:38 +0200)]
memmem: Avoid wrong configure results with "clang -fsanitize=undefined".

Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.

* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Use NULL + 1, not NULL.

4 years agoregex: Avoid wrong configure results with "clang -fsanitize=leak".
Bruno Haible [Thu, 21 May 2020 18:28:56 +0000 (20:28 +0200)]
regex: Avoid wrong configure results with "clang -fsanitize=leak".

Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.

* m4/regex.m4 (gl_REGEX): Free compiled regexes and allocated registers
before returning with status 0.

4 years agoglob: Avoid wrong configure results with "clang -fsanitize=leak".
Bruno Haible [Thu, 21 May 2020 17:40:59 +0000 (19:40 +0200)]
glob: Avoid wrong configure results with "clang -fsanitize=leak".

Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.

* m4/glob.m4 (gl_GLOB): Free allocated memory before returning.

4 years agofchownat: Support clang -fsanitize=implicit-integer-sign-change better.
Bruno Haible [Thu, 21 May 2020 15:19:38 +0000 (17:19 +0200)]
fchownat: Support clang -fsanitize=implicit-integer-sign-change better.

Reported by Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00207.html>.

* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG,
gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Cast -1 to uid_t or git_t,
respectively.

4 years agogetdelim: Avoid wrong configure results with gcc -fsanitize=address.
Tim Rühsen [Mon, 18 May 2020 10:36:16 +0000 (12:36 +0200)]
getdelim: Avoid wrong configure results with gcc -fsanitize=address.

* m4/getdelim.m4 (gl_FUNC_GETDELIM): Fix memleak.

4 years agoftoastr: fix ifndef typo
Paul Eggert [Tue, 19 May 2020 20:45:46 +0000 (13:45 -0700)]
ftoastr: fix ifndef typo

* lib/ftoastr.h (_GL_FTOASTR_H): Define.

4 years agohavelib: Tweak documentation.
Bruno Haible [Tue, 19 May 2020 05:48:27 +0000 (07:48 +0200)]
havelib: Tweak documentation.

* doc/havelib.texi (Searching for Libraries): Fix typo.

4 years agovcs-to-changelog: Rename vcs_to_changelog.py to use hyphens.
Siddhesh Poyarekar [Mon, 18 May 2020 13:46:03 +0000 (19:16 +0530)]
vcs-to-changelog: Rename vcs_to_changelog.py to use hyphens.

This was needed earlier because modules had to import the main script,
but that is no longer true.  Rename the script so that it is
consistent with all other scripts in gnulib and uses hyphens.

* build-aux/vcs_to_changelog.py: Rename to...
* build-aux/vcs-to-changelog.py: ... this.
* doc/vcs-to-changelog.texi (VCS To ChangeLog): Update reference.
* modules/vcs-to-changelog: Likewise.

4 years agoClarify intended usage of the license file modules.
Bruno Haible [Sun, 17 May 2020 17:27:08 +0000 (19:27 +0200)]
Clarify intended usage of the license file modules.

Reported by Asher Gordon <AsDaGo@posteo.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00126.html>.

* doc/licenses-texi.texi (License Texinfo sources): Mention the
GNU AGPL. Explain the intended usage of the modules.
* modules/fdl (Notice): Discourage use as a module.
* modules/fdl-1.3 (Notice): Likewise.

4 years agohash: add hash_xinsert
Akim Demaille [Sun, 17 May 2020 09:55:12 +0000 (11:55 +0200)]
hash: add hash_xinsert

* lib/hash.h, lib/xhash.c (hash_xinsert): New.

4 years agofindprog-lgpl: Fix link error (existing since 2008-09-02).
Bruno Haible [Sat, 16 May 2020 15:19:42 +0000 (17:19 +0200)]
findprog-lgpl: Fix link error (existing since 2008-09-02).

* modules/findprog-lgpl (Makefile.am): Arrange to compile
findprog-lgpl.c, not findprog.c.
* lib/findprog.c (find_in_path): Add LGPLed replacement code for
XNMALLOC.

4 years agoc-stack: pacify -Wunused-result when DEBUG
Paul Eggert [Fri, 15 May 2020 20:58:30 +0000 (13:58 -0700)]
c-stack: pacify -Wunused-result when DEBUG

Problem reported by Marc Nieper-Wißkirchen in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00132.html
* lib/c-stack.c (segv_handler, overflow_handler, segv_handler) [DEBUG]:
Explicitly ignore write failures.

4 years agoannounce-gen: improve a comment
Jim Meyering [Wed, 13 May 2020 23:14:18 +0000 (16:14 -0700)]
announce-gen: improve a comment

* build-aux/announce-gen: Improve comment.

4 years agoxalloc: pacify -Wanalyzer-possible-null-argument
Paul Eggert [Tue, 12 May 2020 16:24:05 +0000 (09:24 -0700)]
xalloc: pacify -Wanalyzer-possible-null-argument

Problem reported for GCC 10.1.0 by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00118.html
* lib/xmalloc.c (HAVE_GNU_MALLOC, HAVE_GNU_REALLOC): New constants.
(xmalloc): Suppress unnecessary check if HAVE_GNU_MALLOC.
(xrealloc): Suppress unnecssary check if HAVE_GNU_REALLOC.

5 years agocareadlinkat: fix GCC 10 workaround
Paul Eggert [Mon, 11 May 2020 17:46:07 +0000 (10:46 -0700)]
careadlinkat: fix GCC 10 workaround

* lib/careadlinkat.c (careadlinkat) [GCC_LINT]:
Massage the code so that it’s closer to what it was before
the GCC 10.1.0 workaround was introduced.  This fixes
a loop when !buffer and the bug workaround is in effect.
Remove unnecessary casts.  Defend in a different way
against (buffer && !buffer_size), by adding at least 1
to buf_size each time through the loop.

5 years agodoc: Mark HP-UX as unsupported.
Bruno Haible [Mon, 11 May 2020 00:32:32 +0000 (02:32 +0200)]
doc: Mark HP-UX as unsupported.

* doc/gnulib-intro.texi (Target Platforms): List HP-UX as unsupported.

5 years agocareadlinkat: limit GCC workaround
Paul Eggert [Mon, 11 May 2020 00:07:47 +0000 (17:07 -0700)]
careadlinkat: limit GCC workaround

* lib/careadlinkat.c (careadlinkat): Limit workaround to GCC
10.1.0 and later, since the workaround is pretty bad and the GCC
bug should get fixed.

5 years agoattribute: Tweak comment.
Bruno Haible [Sun, 10 May 2020 20:22:07 +0000 (22:22 +0200)]
attribute: Tweak comment.

Reported by Paul Eggert.

* lib/attribute.h: Tweak a category's description.

5 years agohavelib: Enhance documentation.
Bruno Haible [Sun, 10 May 2020 17:54:58 +0000 (19:54 +0200)]
havelib: Enhance documentation.

* doc/havelib.texi (Searching for Libraries): Mention the bad
consequences of using LIBxxx instead of LTLIBxxx and vice versa.

5 years agoattribute: Clarify list of attributes.
Bruno Haible [Sun, 10 May 2020 17:18:44 +0000 (19:18 +0200)]
attribute: Clarify list of attributes.

* lib/attribute.h: Reorder the list of attributes, and group them by
purpose.

5 years agostring: Fix compilation error in C++ mode.
Bruno Haible [Sun, 10 May 2020 16:14:38 +0000 (18:14 +0200)]
string: Fix compilation error in C++ mode.

* lib/warn-on-use.h (_GL_WARN_ON_USE_CXX): In C mode, use plain
_GL_WARN_ON_USE.
* lib/string.in.h (strchr, strpbrk, strrchr): Use _GL_WARN_ON_USE_CXX
instead of _GL_WARN_ON_USE.

5 years agoannounce-gen: add support for dist-lzip
Akim Demaille [Sun, 10 May 2020 16:11:04 +0000 (18:11 +0200)]
announce-gen: add support for dist-lzip

* build-aux/announce-gen (@archive_suffixes): Add tar.lz.

5 years agomanywarnings: port to GCC 10.1
Paul Eggert [Sun, 10 May 2020 01:07:38 +0000 (18:07 -0700)]
manywarnings: port to GCC 10.1

* build-aux/gcc-warning.spec:
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)):
Add GCC 10.1.0 warnings.

5 years agocareadlinkat: pacify -Wreturn-local-addr
Paul Eggert [Sun, 10 May 2020 01:01:59 +0000 (18:01 -0700)]
careadlinkat: pacify -Wreturn-local-addr

* lib/careadlinkat.c (careadlinkat) [GCC_LINT]:
Pacify gcc 10’s -Wreturn-local-addr option.
Simplify some of the later code.

5 years agoattribute: remove ATTRIBUTE_DEPRECATED
Paul Eggert [Sat, 9 May 2020 19:00:08 +0000 (12:00 -0700)]
attribute: remove ATTRIBUTE_DEPRECATED

* lib/attribute.h: Improve recently-added comments, mostly
by shortening them (use active voice, etc.).
(ATTRIBUTE_DEPRECATED): Remove, as it duplicates DEPRECATED.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00089.html

5 years agoattribute: Add comments.
Bruno Haible [Sat, 9 May 2020 15:35:57 +0000 (17:35 +0200)]
attribute: Add comments.

* lib/attribute.h: Document each macro.

5 years agobitset: use the attribute module
Akim Demaille [Sat, 9 May 2020 11:31:07 +0000 (13:31 +0200)]
bitset: use the attribute module

* modules/bitset: Depend on 'attribute'.
* lib/bitset/base.h (ATTRIBUTE_UNUSED): Remove.
* lib/bitset.c, lib/bitset/array.c, lib/bitset/list.c,
* lib/bitset/stats.c, lib/bitset/table.c, lib/bitset/vector.c:
Use MAYBE_UNUSED instead of ATTRIBUTE_UNUSED.

5 years agoc-stack: Fix warning when DEBUG is enabled.
Bruno Haible [Sat, 9 May 2020 11:32:44 +0000 (13:32 +0200)]
c-stack: Fix warning when DEBUG is enabled.

Patch suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00081.html>.

* lib/c-stack.c: Include <stdio.h>.

5 years agoRemove redundant definitions of _GL_ATTRIBUTE_FORMAT.
Bruno Haible [Sat, 9 May 2020 11:22:49 +0000 (13:22 +0200)]
Remove redundant definitions of _GL_ATTRIBUTE_FORMAT.

* lib/argp.h (_GL_ATTRIBUTE_FORMAT): Remove macro.
* lib/argp-fmtstream.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/c-snprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/c-vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/c-vasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/c-vsnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/c-xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/error.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/parse-datetime.y (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/xprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise.

5 years agoRemove redundant definitions of _GL_ATTRIBUTE_ALLOC_SIZE.
Bruno Haible [Sat, 9 May 2020 11:14:24 +0000 (13:14 +0200)]
Remove redundant definitions of _GL_ATTRIBUTE_ALLOC_SIZE.

Reported by Akim Demaille in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00077.html>.

* lib/eealloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Remove macro.
* lib/pagealign_alloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Likewise.
* lib/xalloc.h (_GL_ATTRIBUTE_ALLOC_SIZE): Likewise.

5 years agostdio, monetary: Don't redefine _GL_ATTRIBUTE_FORMAT.
Bruno Haible [Sat, 9 May 2020 10:58:23 +0000 (12:58 +0200)]
stdio, monetary: Don't redefine _GL_ATTRIBUTE_FORMAT.

* lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT): Don't override the definition
that usually comes from m4/gnulib-common.m4.
* lib/monetary.in.h (_GL_ATTRIBUTE_FORMAT): Likewise.

5 years agodirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE.
Bruno Haible [Sat, 9 May 2020 10:50:57 +0000 (12:50 +0200)]
dirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE.

* lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Don't override the definition
that usually comes from m4/gnulib-common.m4.
* lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise.

5 years agouchar: Work around incorrect char16_t, char32_t types on Haiku 2020.
Bruno Haible [Sat, 9 May 2020 08:51:57 +0000 (10:51 +0200)]
uchar: Work around incorrect char16_t, char32_t types on Haiku 2020.

* lib/uchar.in.h (char16_t): Define as macro if
GNULIB_OVERRIDES_CHAR16_T.
(char32_t): Define as macro if GNULIB_OVERRIDES_CHAR32_T.
* m4/uchar.m4 (gl_TYPE_CHAR16_T, gl_TYPE_CHAR32_T): New macros.
(gl_UCHAR_H): Invoke them.
(gl_UCHAR_H_DEFAULTS): Initialize GNULIB_OVERRIDES_CHAR16_T,
GNULIB_OVERRIDES_CHAR32_T.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32, gl_MBRTOC32_SANITYCHECK): Require
gl_TYPE_CHAR32_T and test GNULIB_OVERRIDES_CHAR32_T.
* modules/uchar (Makefile.am): Substitute GNULIB_OVERRIDES_CHAR16_T,
GNULIB_OVERRIDES_CHAR32_T.

5 years agoMacro tweaks.
Bruno Haible [Sat, 9 May 2020 08:33:45 +0000 (10:33 +0200)]
Macro tweaks.

* m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Correct config.h comment.
* m4/wint_t.m4 (gt_TYPE_WINT_T): Correct indentation.

5 years agoc32rtomb: Avoid compilation failure on Haiku.
Bruno Haible [Sat, 9 May 2020 00:55:06 +0000 (02:55 +0200)]
c32rtomb: Avoid compilation failure on Haiku.

* m4/c32rtomb.m4 (gl_FUNC_C32RTOMB): Test for c32rtomb without excluding
inline definitions.
* doc/posix-functions/c32rtomb.texi: Mention the Haiku problem.

5 years agombrtoc32: Avoid compilation failure on Haiku.
Bruno Haible [Sat, 9 May 2020 00:52:48 +0000 (02:52 +0200)]
mbrtoc32: Avoid compilation failure on Haiku.

* m4/mbrtoc32.m4 (gl_CHECK_FUNC_MBRTOC32): New macro.
(gl_FUNC_MBRTOC32, gl_MBRTOC32_SANITYCHECK): Use it instead of
AC_CHECK_FUNCS_ONCE.
* doc/posix-functions/mbrtoc32.texi: Mention the Haiku problem.

5 years agolimits-h: Define LONG_BIT correctly on Haiku/x86_64.
Bruno Haible [Fri, 8 May 2020 22:29:37 +0000 (00:29 +0200)]
limits-h: Define LONG_BIT correctly on Haiku/x86_64.

* lib/limits.in.h: Define and test _GL_ALREADY_INCLUDING_LIMITS_H.

5 years agolist: Update documentation.
Bruno Haible [Fri, 8 May 2020 17:25:39 +0000 (19:25 +0200)]
list: Update documentation.

Reported by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00062.html>.

* doc/containers.texi (Container data types): Document the new list
operations and their complexity.

5 years agoignore-value tests: Use module 'attribute'.
Bruno Haible [Fri, 8 May 2020 16:30:01 +0000 (18:30 +0200)]
ignore-value tests: Use module 'attribute'.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Fix a typo.
* tests/test-ignore-value.c: Include attribute.h.
(_GL_ATTRIBUTE_RETURN_CHECK): Remove macro. Use NODISCARD instead.
* modules/ignore-value-tests (Depends-on): Add attribute.

5 years agouniname/uniname: Use module 'attribute'.
Bruno Haible [Fri, 8 May 2020 16:09:23 +0000 (18:09 +0200)]
uniname/uniname: Use module 'attribute'.

* lib/uniname/gen-uninames.lisp: Emit a reference to ATTRIBUTE_PACKED.
* lib/uniname/uninames.h: Regenerated.
* lib/uniname/uniname.c: Include attribute.h.
* modules/uniname/uniname (Depends-on): Add attribute.

5 years agoc32rtomb: Use module 'attribute'.
Bruno Haible [Fri, 8 May 2020 16:07:17 +0000 (18:07 +0200)]
c32rtomb: Use module 'attribute'.

* lib/c32rtomb.c: Include attribute.h.
(FALLTHROUGH): Remove macro.
* modules/c32rtomb (Depends-on): Add attribute.

5 years agoxsize: Use module 'attribute'.
Bruno Haible [Fri, 8 May 2020 16:05:35 +0000 (18:05 +0200)]
xsize: Use module 'attribute'.

* lib/xsize.h: Include attribute.h. Use ATTRIBUTE_PURE.
* modules/xsize (Depends-on): Add attribute.

5 years agoautoupdate
Karl Berry [Fri, 8 May 2020 16:41:01 +0000 (09:41 -0700)]
autoupdate

5 years ago* m4/gnulib-common.m4 (gl_COMMON_BODY): Minor style fixes.
Paul Eggert [Wed, 6 May 2020 22:51:49 +0000 (15:51 -0700)]
* m4/gnulib-common.m4 (gl_COMMON_BODY): Minor style fixes.

5 years ago* lib/attribute.h: Minor style fixes.
Paul Eggert [Wed, 6 May 2020 22:51:32 +0000 (15:51 -0700)]
* lib/attribute.h: Minor style fixes.

5 years agoFix version-etc glitch on OpenIndiana
Paul Eggert [Wed, 6 May 2020 22:51:10 +0000 (15:51 -0700)]
Fix version-etc glitch on OpenIndiana

Problem reported by Mats Erik Andersson in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00067.html
* lib/version-etc.h (_GL_ATTRIBUTE_SENTINEL): Remove defn
that now clashes with gnulib-common.h.  All uses changed.

5 years agoautoupdate
Karl Berry [Wed, 6 May 2020 15:15:00 +0000 (08:15 -0700)]
autoupdate

5 years agoautoupdate
Karl Berry [Tue, 5 May 2020 14:44:25 +0000 (07:44 -0700)]
autoupdate

5 years agoattribute: add _GL_ATTRIBUTE_RETURNS_NONNULL
Paul Eggert [Sun, 3 May 2020 21:32:38 +0000 (14:32 -0700)]
attribute: add _GL_ATTRIBUTE_RETURNS_NONNULL

5 years agoattribute: minor fixups
Paul Eggert [Sun, 3 May 2020 20:58:06 +0000 (13:58 -0700)]
attribute: minor fixups

Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2020-05/msg00049.html

5 years agoattribute: new module
Paul Eggert [Sat, 2 May 2020 01:12:12 +0000 (18:12 -0700)]
attribute: new module

This simplifies use of GCC and C2X attributes like ‘deprecated’.
* MODULES.html.sh: Add attribute.
* doc/attribute.texi, lib/attribute.h, modules/attribute: New files.
* doc/gnulib.texi (Particular Modules): Add Attributes.
* lib/backupfile.c, lib/fnmatch.c, lib/freopen-safer.c:
* lib/mbrtoc32.c, lib/mbrtowc.c, lib/nstrftime.c, lib/quotearg.c:
* lib/savewd.c, lib/unistr/u8-uctomb-aux.c, lib/unistr/u8-uctomb.c:
* lib/vasnprintf.c:
Include attribute.h, and let it define FALLTHROUGH.
* lib/bitset/base.h, lib/c-stack.c (__attribute__): Remove macro.
* lib/bitset/base.h (ATTRIBUTE_UNUSED): Define in terms of
_GL_ATTRIBUTE_MAYBE_UNUSED, for forwards compatibility to C2X.
* lib/dfa.c (FALLTHROUGH): Define consistently with gl_COMMON_BODY.
This is a copy since Gawk doesn’t use Gnulib.
* lib/di-set.h (_GL_ATTRIBUTE_NONNULL): Remove definition that
is incompatible with gl_COMMON_BODY’s.  All uses changed.
* lib/fts.c: Include attribte.h, for FALLTHROUGH.
Keep the existing FALLTHROUGH definition since Glibc might use it,
and it does no harm to Gnulib’s FALLTHROUGH.
* lib/fts_.h, lib/inttostr.h:
(__GNUC_PREREQ): Remove; no longer needed.
(__attribute_warn_unused_result__): Remove.  All uses
replaced by _GL_ATTRIBUTE_NODISCARD.
* lib/gl_list.h, lib/gl_map.h, lib/gl_omap.h, lib/gl_oset.h:
* lib/gl_set.h: Prefer _GL_ATTRIBUTE_NODISCARD to an ifdeffed
__attribute__ ((__warn_unused_result__)), for forward
compatibility to C2X.
* lib/hash.h (_GL_ATTRIBUTE_WUR): Remove.  All uses replaced by
_GL_ATTRIBUTE_NODISCARD.
(_GL_ATTRIBUTE_DEPRECATED): Remove, since gl_COMMON_BODY defines it.
* lib/ino-map.h (_GL_ATTRIBUTE_NONNULL): Remove.  All uses
replaced by gl_COMMON_BODY’s implementation, which has a
slightly different signature.
* lib/safe-alloc.h (_GL_ATTRIBUTE_RETURN_CHECK):
Remove.  All uses replaced by _GL_ATTRIBUTE_NODISCARD.
* lib/unused-parameter.h (_GL_UNUSED_PARAMETER):
Define in terms of _GL_ATTRIBUTE_MAYBE_UNUSED.
No doubt all uses should be replaced, at some point.
* m4/gnulib-common.m4 (_GL_GNUC_PREREQ): New macro.
(_Noreturn): Use it.
(_GL_HAS_ATTRIBUTE, _GL_ATTRIBUTE_ALLOC_SIZE)
(_GL_ATTRIBUTE_ALWAYS_INLINE, _GL_ATTRIBUTE_ARTIFICIAL)
(_GL_ATTRIBUTE_COLD)
(_GL_ATTRIBUTE_DEPRECATED, _GL_ATTRIBUTE_ERROR)
(_GL_ATTRIBUTE_WARNING, _GL_ATTRIBUTE_EXTERNALLY_VISIBLE)
(_GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT)
(_GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MAY_ALIAS)
(_GL_ATTRIBUTE_MAYBE_UNUSED)
(_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE)
(_GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_NONSTRING)
(_GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE)
(_GL_ATTRIBUTE_SENTINEL): New macros.
* modules/backup-rename, modules/backupfile, modules/c-vasnprintf:
* modules/fnmatch, modules/freopen-safer, modules/fts:
* modules/mbrtoc32, modules/mbrtowc, modules/nstrftime:
* modules/quotearg, modules/savewd:
* modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf:
* modules/unistdio/ulc-vasnprintf:
* modules/unistr/u8-uctomb, modules/vasnprintf:
(Depends-on:): Add attribute module.

5 years agobison: Fix today's commit.
Bruno Haible [Sun, 3 May 2020 12:16:43 +0000 (14:16 +0200)]
bison: Fix today's commit.

* m4/bison.m4 (gl_PROG_BISON): Set ac_verc_fail to 'yes', not 'true'.

5 years agolist-c++: Add get_first, get_last, set_first, set_last operations.
Bruno Haible [Sun, 3 May 2020 11:13:00 +0000 (13:13 +0200)]
list-c++: Add get_first, get_last, set_first, set_last operations.

* lib/gl_list.hh (class gl_List): Add methods get_first, get_last,
set_first, set_last.
* lib/gl_list.h: Tweak comments.

5 years agobison: rely on bison's %require to check a version requirement
Akim Demaille [Sun, 3 May 2020 06:54:58 +0000 (08:54 +0200)]
bison: rely on bison's %require to check a version requirement

See https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00021.html.

* m4/bison.m4 (gl_PROG_BISON): Let bison itself decide if it it recent
enough of not.
So far it is the only know Yacc tool that supports '%require'.
Other yaccs will actually even choke on seeing the -o option after the
input file name.
* m4/parse-datetime.m4: Simplify gl_PROG_BISON invocation.

5 years agolist: Add get_first, get_last, set_first, set_last operations.
Bruno Haible [Sat, 2 May 2020 21:21:00 +0000 (23:21 +0200)]
list: Add get_first, get_last, set_first, set_last operations.

* lib/gl_list.h (gl_list_get_first, gl_list_get_last,
gl_list_nx_set_first, gl_list_nx_set_last): New functions.
* lib/gl_xlist.h (gl_list_set_first, gl_list_set_last): New functions.

5 years agolist: Remove redundant code for remove_first and remove_last operations.
Bruno Haible [Sat, 2 May 2020 19:14:29 +0000 (21:14 +0200)]
list: Remove redundant code for remove_first and remove_last operations.

* lib/gl_list.h (struct gl_list_implementation): Remove fields
remove_first, remove_last.
(gl_list_remove_first, gl_list_remove_last): Implement in a generic way.
* lib/gl_array_list.c: Revert last change.
* lib/gl_carray_list.c: Likewise.
* lib/gl_anylinked_list2.h: Likewise.
* lib/gl_linked_list.c: Likewise.
* lib/gl_linkedhash_list.c: Likewise.
* lib/gl_anytree_list2.h: Likewise.
* lib/gl_avltree_list.c: Likewise.
* lib/gl_avltreehash_list.c: Likewise.
* lib/gl_rbtree_list.c: Likewise.
* lib/gl_rbtreehash_list.c: Likewise.
* lib/gl_sublist.c: Likewise.

5 years agoautoupdate
Karl Berry [Sat, 2 May 2020 16:10:58 +0000 (09:10 -0700)]
autoupdate

5 years agobison-i18n: Fix typo in last commit.
Bruno Haible [Sat, 2 May 2020 15:36:56 +0000 (17:36 +0200)]
bison-i18n: Fix typo in last commit.

* m4/bison-i18n.m4 (BISON_I18N): Fix typo in the --help output.

5 years agobison-i18n: Add support for cross-compilation.
Bruno Haible [Sat, 2 May 2020 15:23:01 +0000 (17:23 +0200)]
bison-i18n: Add support for cross-compilation.

Reported by Hongxu Jia <hongxu.jia@windriver.com> in
<https://lists.gnu.org/archive/html/bison-patches/2016-02/msg00000.html>
via Akim Demaille <akim@lrde.epita.fr>.

* m4/bison-i18n.m4 (BISON_I18N): Accept a configure option
--with-bison-prefix=PREFIX and use it to determine BISON_LOCALEDIR.
Don't use bison's --print-localedir option when cross-compiling.
Also, fix an error message and a comment.

5 years agolist: Add remove_first and remove_last operations.
Bruno Haible [Fri, 1 May 2020 23:56:17 +0000 (01:56 +0200)]
list: Add remove_first and remove_last operations.

Suggested by Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-04/msg00092.html>.

* lib/gl_list.h (struct gl_list_implementation): Add fields
remove_first, remove_last.
(gl_list_remove_first, gl_list_remove_last): New functions.
* lib/gl_array_list.c (gl_array_remove_first, gl_array_remove_last): New
functions, based on gl_array_remove_at.
(gl_array_list_implementation): Implement the new operations.
* lib/gl_carray_list.c (gl_carray_remove_first, gl_carray_remove_last):
New functions, based on gl_carray_remove_at.
(gl_carray_list_implementation): Implement the new operations.
* lib/gl_anylinked_list2.h (gl_linked_remove_first,
gl_linked_remove_last): New functions, based on gl_linked_remove_at.
* lib/gl_linked_list.c (gl_linked_list_implementation): Implement the
new operations.
* lib/gl_linkedhash_list.c (gl_linkedhash_list_implementation):
Likewise.
* lib/gl_anytree_list2.h (gl_tree_remove_first, gl_tree_remove_last):
New functions, based on gl_tree_remove_at.
* lib/gl_avltree_list.c (gl_avltree_list_implementation): Implement the
new operations.
* lib/gl_avltreehash_list.c (gl_avltreehash_list_implementation):
Likewise.
* lib/gl_rbtree_list.c (gl_rbtree_list_implementation): Likewise.
* lib/gl_rbtreehash_list.c (gl_rbtreehash_list_implementation):
Likewise.
* lib/gl_sublist.c (gl_sublist_remove_first, gl_sublist_remove_last):
New functions, based on gl_sublist_remove_at.
(gl_sublist_list_implementation): Implement the new operations.
* lib/gl_list.hh (class gl_List): Add methods remove_first,
remove_last.
* tests/test-array_list.c (main): Test also gl_list_remove_first and
gl_list_remove_last.
* tests/test-avltree_list.c (main): Likewise.
* tests/test-avltreehash_list.c (main): Likewise.
* tests/test-carray_list.c (main): Likewise.
* tests/test-linked_list.c (main): Likewise.
* tests/test-linkedhash_list.c (main): Likewise.
* tests/test-rbtree_list.c (main): Likewise.
* tests/test-rbtreehash_list.c (main): Likewise.