]> Savannah Git Hosting - gnulib.git/log
gnulib.git
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.

5 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.

5 years agoparse-datetime: Fix a build failure with an older bison version.
Bruno Haible [Fri, 1 May 2020 16:11:13 +0000 (18:11 +0200)]
parse-datetime: Fix a build failure with an older bison version.

* modules/parse-datetime (Makefile.am): Don't do the post-processing of
parse-datetime.tab.c if a suitable version of bison was not found.

5 years agobison: New module.
Bruno Haible [Fri, 1 May 2020 16:06:05 +0000 (18:06 +0200)]
bison: New module.

* m4/bison.m4 (gl_PROG_BISON): New macro, extracted from
m4/parse-datetime.m4.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Invoke gl_PROG_BISON.
* modules/bison: New file.
* modules/parse-datetime (Files): Remove m4/bison.m4.
(Depends-on): Add bison.

5 years agoAdd poke to users.txt
Jose E. Marchesi [Fri, 1 May 2020 10:26:45 +0000 (12:26 +0200)]
Add poke to users.txt

5 years agoposix_spawn_file_actions_addfchdir tests: Enhance test.
Bruno Haible [Tue, 28 Apr 2020 10:35:19 +0000 (12:35 +0200)]
posix_spawn_file_actions_addfchdir tests: Enhance test.

* tests/test-posix_spawn5.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on): Add
findprog.

5 years agoposix_spawn_file_actions_addchdir tests: Enhance test.
Bruno Haible [Tue, 28 Apr 2020 10:34:19 +0000 (12:34 +0200)]
posix_spawn_file_actions_addchdir tests: Enhance test.

* tests/test-posix_spawn4.c: Include findprog.h.
(test): New function, extracted from main.
(main): Invoke it. Also, invoke it with a program name such as
"bin/pwd".
* modules/posix_spawn_file_actions_addchdir-tests (Depends-on): Add
findprog.

5 years agoposix_spawn_file_actions_destroy: Fix a crash (bug from 2019-06-10).
Bruno Haible [Tue, 28 Apr 2020 10:29:04 +0000 (12:29 +0200)]
posix_spawn_file_actions_destroy: Fix a crash (bug from 2019-06-10).

* lib/spawn_faction_destroy.c (posix_spawn_file_actions_destroy): Don't
access elements of the wrong union member.

5 years agogetdate: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:50:17 +0000 (01:50 +0200)]
getdate: Remove deprecated module.

* modules/getdate: Remove file.
* doc/getdate.texi: Remove file.
* lib/getdate.h: Remove file.
* NEWS: Mention the removal.

5 years agorealloc: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:43:26 +0000 (01:43 +0200)]
realloc: Remove deprecated module.

* modules/realloc: Remove file.
* NEWS: Mention the removal.

5 years agocalloc: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:41:55 +0000 (01:41 +0200)]
calloc: Remove deprecated module.

* modules/calloc: Remove file.
* NEWS: Mention the removal.

5 years agomalloc: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:40:19 +0000 (01:40 +0200)]
malloc: Remove deprecated module.

* modules/malloc: Remove file.
* NEWS: Mention the removal.

5 years agofnmatch-posix: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:37:35 +0000 (01:37 +0200)]
fnmatch-posix: Remove deprecated module.

* modules/fnmatch-posix: Remove file.
* MODULES.html.sh (Enhancements for POSIX:2008 functions): Update.
* NEWS: Mention the removal.

5 years agopipe: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:33:26 +0000 (01:33 +0200)]
pipe: Remove deprecated module.

* modules/pipe: Remove file.
* lib/pipe.h: Remove file.
* NEWS: Mention the removal.

5 years agogetopt: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:29:16 +0000 (01:29 +0200)]
getopt: Remove deprecated module.

* modules/getopt: Remove file.
* NEWS: Mention the removal.

5 years agoremove-dest-slash: Remove deprecated module.
Bruno Haible [Mon, 27 Apr 2020 23:25:01 +0000 (01:25 +0200)]
remove-dest-slash: Remove deprecated module.

* modules/rename-dest-slash: Remove file.
* MODULES.html.sh (Compatibility checks for POSIX:2008 functions):
Update.
* NEWS: Mention the removal.

5 years agounictype/bidicategory-*: Remove deprecated modules.
Bruno Haible [Mon, 27 Apr 2020 23:18:11 +0000 (01:18 +0200)]
unictype/bidicategory-*: Remove deprecated modules.

* modules/unictype/bidicategory-all: Remove file.
* modules/unictype/bidicategory-byname: Remove file.
* modules/unictype/bidicategory-name: Remove file.
* modules/unictype/bidicategory-of: Remove file.
* modules/unictype/bidicategory-test: Remove file.
* MODULES.html.sh (Unicode string functions): Update.
* NEWS: Mention the removals.

5 years agoautoupdate
Karl Berry [Sun, 26 Apr 2020 16:03:54 +0000 (09:03 -0700)]
autoupdate

5 years agoTune fts for FTS_LOGICAL+FTS_NOSTAT
Paul Eggert [Sat, 25 Apr 2020 18:02:53 +0000 (11:02 -0700)]
Tune fts for FTS_LOGICAL+FTS_NOSTAT

From a suggestion by Askar Safin in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00074.html
* lib/fts.c (fts_build): If file types are known, optimize
FTS_LOGICAL+FTS_NOSTAT for non-symlinks and non-directories the
same way that we already optimize FTS_PHYSICAL+FTS_NOSTAT for
non-directories.

5 years agoautoupdate
Karl Berry [Sat, 25 Apr 2020 16:17:48 +0000 (09:17 -0700)]
autoupdate

5 years agovasnprintf: Add support for printing wide characters using escapes.
Bruno Haible [Sun, 19 Apr 2020 15:02:16 +0000 (17:02 +0200)]
vasnprintf: Add support for printing wide characters using escapes.

* lib/vasnprintf.c (ENABLE_WCHAR_FALLBACK): Document optional macro.
(wctomb_fallback): New function.
(local_wctomb): New function.
(local_wcrtomb): New function or macro.
(MAX_ROOM_NEEDED): Adjust estimate for %lc.
(VASNPRINTF): Simplify %ls code by use of local_wcrtomb. Add code for
%lc.

5 years agofts: remove NOSTAT_LEAF_OPTIMIZATION
Paul Eggert [Thu, 16 Apr 2020 03:50:32 +0000 (20:50 -0700)]
fts: remove NOSTAT_LEAF_OPTIMIZATION

It caused ‘find’ and ‘du’ to dump core, and it was useful
only for obsolescent Linux filesystems anyway.  Problem reported in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html
Quite possibly there is still a serious underlying fts bug with
tight-loop-check and mutating file systems, but if so this patch
should cause the bug to be triggered less often.
* lib/fts.c (enum leaf_optimization): Remove
NOSTAT_LEAF_OPTIMIZATION, as it’s problematic.
(S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed.
(leaf_optimization): Remove special cases for ReiserFS and XFS.
(fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code.
* lib/fts_.h (struct _ftsent.fts_n_dirs_remaining):
Remove.  All uses removed.

5 years agoexplicit_bzero: Improve code style.
Bastien Roucariès [Mon, 13 Apr 2020 22:48:16 +0000 (00:48 +0200)]
explicit_bzero: Improve code style.

* lib/explicit_bzero.c (explicit_bzero): Use '\0' instead of 0.

5 years agoexplicit_bzero: On native Windows, use SecureZeroMemory().
Bastien Roucariès [Sun, 12 Apr 2020 23:09:15 +0000 (01:09 +0200)]
explicit_bzero: On native Windows, use SecureZeroMemory().

* lib/explicit_bzero.c: Include <windows.h>.
(explicit_bzero): On native Windows, use SecureZeroMemory.

Signed-off-by: Bastien Roucariès <rouca@debian.org>
5 years agoexplicit_bzero: Use memset_s() when available.
Bastien Roucariès [Sun, 12 Apr 2020 23:09:14 +0000 (01:09 +0200)]
explicit_bzero: Use memset_s() when available.

Some OS define memset_s instead of explicit_bzero. Use it.

* lib/explicit_bzero.c (__STDC_WANT_LIB_EXT1__): Define.
(explicit_bzero): Use memset_s when available.
* m4/explicit_bzero.m4 (gl_PREREQ_EXPLICIT_BZERO): Test for memset_s.

Signed-off-by: Bastien Roucariès <rouca@debian.org>
5 years agoexplicit_bzero tests: Fix test failure on OpenBSD 6.5.
Bastien Roucariès [Sun, 12 Apr 2020 23:09:13 +0000 (01:09 +0200)]
explicit_bzero tests: Fix test failure on OpenBSD 6.5.

Some implementation could add canaries after free failling the test.

* tests/test-explicit_bzero.c (test_heap): Handle implementations of
free() that overwrite the memory with canaries.

Signed-off-by: Bastien Roucariès <rouca@debian.org>
5 years agobootstrap: recommend git submodule update --init
Akim Demaille [Mon, 13 Apr 2020 15:39:38 +0000 (17:39 +0200)]
bootstrap: recommend git submodule update --init

Reported by Bruno Haible.
<https://lists.gnu.org/r/bug-gnulib/2020-03/msg00101.html>

* build-aux/bootstrap: recommand "git submodule update --init"
rather than "git submodule init".

5 years agoexplicit_bzero: Add tests.
Bruno Haible [Sun, 12 Apr 2020 19:00:10 +0000 (21:00 +0200)]
explicit_bzero: Add tests.

* tests/test-explicit_bzero.c: New file.
* modules/explicit_bzero-tests: New file.

5 years agoexplicit_bzero: Relicense under LGPLv2+.
Bruno Haible [Sat, 11 Apr 2020 23:00:47 +0000 (01:00 +0200)]
explicit_bzero: Relicense under LGPLv2+.

Approved by Paul Eggert.

* modules/explicit_bzero (License): Change to LGPLv2+.

5 years agofindprog, relocatable-prog: Ignore directories during PATH search.
Bruno Haible [Fri, 10 Apr 2020 13:57:10 +0000 (15:57 +0200)]
findprog, relocatable-prog: Ignore directories during PATH search.

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

* lib/findprog.c (find_in_path): When the file found in a PATH element
is a directory, continue searching.
* modules/findprog (Depends-on): Add sys_stat, stat.
* modules/findprog-lgpl (Depends-on): Likewise.

* lib/progreloc.c (maybe_executable): When the file found in a PATH
element is a directory, continue searching.
* lib/relocwrapper.c: Update comments.
* modules/relocatable-prog-wrapper (Files): Add m4/largefile.m4.
(configure.ac-early): New section.

5 years agoMODULES.html.sh: Support for reproducible builds from git-less tarballs.
Bruno Haible [Fri, 10 Apr 2020 12:21:47 +0000 (14:21 +0200)]
MODULES.html.sh: Support for reproducible builds from git-less tarballs.

Reported by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00061.html>.

* MODULES.html.sh: In a git-less tarball, use the date of the first
ChangeLog entry.

5 years agoFix comments: The gettext library is under LGPL 2.1, not LGPL 2.0.
Bruno Haible [Sat, 4 Apr 2020 15:34:32 +0000 (17:34 +0200)]
Fix comments: The gettext library is under LGPL 2.1, not LGPL 2.0.

* m4/gettext.m4: Fix comments regarding the gettext library.
* m4/intl-thread-locale.m4: Likewise.
* m4/intlmacosx.m4: Likewise.
* m4/lcmessage.m4: Likewise.
* m4/nls.m4: Likewise.
* m4/po.m4: Likewise.
* m4/progtest.m4: Likewise.

5 years agoChangeLog: s/g/git/ in previous description.
Jim Meyering [Sat, 4 Apr 2020 15:14:04 +0000 (08:14 -0700)]
ChangeLog: s/g/git/ in previous description.

5 years agomaint: remove a stray inter-word space in a 6x-repeated comment
Jim Meyering [Sat, 4 Apr 2020 15:11:47 +0000 (08:11 -0700)]
maint: remove a stray inter-word space in a 6x-repeated comment

Induce the changes by running this:
  re='by  perl'; g grep -l "$re"|xargs perl -pi -e "s/$re/by perl/"
* build-aux/announce-gen: Change "by  perl" to "by perl".
* build-aux/gitlog-to-changelog: Likewise.
* build-aux/prefix-gnulib-mk: Likewise.
* build-aux/update-copyright: Likewise.
* build-aux/useless-if-before-free: Likewise.
* tests/test-update-copyright.sh: Likewise.

5 years agoautoupdate
Karl Berry [Wed, 1 Apr 2020 16:52:15 +0000 (09:52 -0700)]
autoupdate

5 years agoUse module 'filename' instead of module 'dosname'.
Bruno Haible [Sat, 28 Mar 2020 14:54:12 +0000 (15:54 +0100)]
Use module 'filename' instead of module 'dosname'.

* lib/at-func.c: Include filename.h instead of dosname.h.
* lib/unlinkat.c: Likewise.
* modules/areadlinkat (Depends-on): Add filename. Remove dosname.
* modules/areadlinkat-with-size (Depends-on): Likewise.
* modules/faccessat (Depends-on): Likewise.
* modules/fchmodat (Depends-on): Likewise.
* modules/fchownat (Depends-on): Likewise.
* modules/fstatat (Depends-on): Likewise.
* modules/mkdirat (Depends-on): Likewise.
* modules/mkfifoat (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/selinux-at (Depends-on): Likewise.
* modules/symlinkat (Depends-on): Likewise.
* modules/unlinkat (Depends-on): Likewise.
* modules/utimensat (Depends-on): Likewise.

* lib/at-func2.c: Include filename.h instead of dosname.h.
* modules/linkat (Depends-on): Add filename. Remove dosname.
* modules/renameatu (Depends-on): Likewise.

* lib/canonicalize.c: Include filename.h instead of dosname.h.
* lib/canonicalize-lgpl.c: Likewise.
* modules/canonicalize (Depends-on): Add filename.
* modules/canonicalize-lgpl (Depends-on): Likewise.

* lib/dirname.h: Include filename.h instead of dosname.h.
* modules/dirname-lgpl (Depends-on): Add filename. Remove dosname.

* lib/fchdir.c: Include filename.h instead of dosname.h.
* modules/fchdir (Depends-on): Add filename. Remove dosname.

* lib/openat.c: Include filename.h instead of dosname.h.
* modules/openat (Depends-on): Add filename. Remove dosname.

* lib/rmdir.c: Include filename.h instead of dosname.h.
* modules/rmdir (Depends-on): Add filename. Remove dosname.

* lib/savewd.c: Include filename.h instead of dosname.h.
* modules/savewd (Depends-on): Add filename. Remove dosname.

* lib/unlink.c: Include filename.h instead of dosname.h.
* modules/unlink (Depends-on): Add filename. Remove dosname.

* modules/relocatable-prog-wrapper (Depends-on): Add filename.
* lib/relocwrapper.c: Update comments.

* modules/lstat (Depends-on): Remove dosname.

5 years agodosname: Redirect to 'filename'.
Bruno Haible [Sat, 28 Mar 2020 14:12:41 +0000 (15:12 +0100)]
dosname: Redirect to 'filename'.

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

* lib/dosname.h: Remove all definitions. Just include filename.h.
* modules/dosname (Status, Notice): Mark as deprecated.
(Depends-on): Add 'filename'.

5 years agodosname: Change IS_RELATIVE_FILE_NAME.
Bruno Haible [Sat, 28 Mar 2020 13:59:24 +0000 (14:59 +0100)]
dosname: Change IS_RELATIVE_FILE_NAME.

* lib/dosname.h (IS_RELATIVE_FILE_NAME): On native Windows, OS/2, DOS,
change the definition so that IS_RELATIVE_FILE_NAME("c:") is false.
* NEWS: Mention the change.

5 years agofilename: Copy some definitions from module 'dosname'.
Bruno Haible [Sat, 28 Mar 2020 13:06:05 +0000 (14:06 +0100)]
filename: Copy some definitions from module 'dosname'.

* lib/filename.h: Include <string.h>, for IS_FILE_NAME_WITH_DIR.
(HAS_DEVICE): Document macro.
(FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE): New macro.
(IS_ABSOLUTE_FILE_NAME): Consider
FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE.
(IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New macros.
(IS_ABSOLUTE_PATH, IS_PATH_WITH_DIR): Define as deprecated aliases.
* lib/relocatable.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(DllMain): Update.
* lib/progreloc.c (IS_FILE_NAME_WITH_DIR): Renamed from
IS_PATH_WITH_DIR.
(find_executable): Update.
* NEWS: Document the deprecations.

5 years agogetopt-posix: port __GETOPT_PREFIX to macOS
Paul Eggert [Wed, 25 Mar 2020 19:13:33 +0000 (12:13 -0700)]
getopt-posix: port __GETOPT_PREFIX to macOS

* lib/getopt-pfx-core.h (_GETOPT) [__APPLE__ && __GETOPT_PREFIX]:
Define to work around a problem with asm on macOS (Bug#40205).

5 years agoMODULES.html.sh: Add support for reproducible builds.
Bruno Haible [Sun, 22 Mar 2020 17:11:49 +0000 (18:11 +0100)]
MODULES.html.sh: Add support for reproducible builds.

Reported by Bernhard M. Wiedemann <bwiedemann@suse.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00024.html>.

* MODULES.html.sh: Print the date of the last gnulib commit, not the
current date.

5 years agoSeveral modules: Depend on stat.
Bruno Haible [Sun, 22 Mar 2020 12:38:45 +0000 (13:38 +0100)]
Several modules: Depend on stat.

* modules/acl-permissions (Depends-on): Add stat.
* modules/canonicalize (Depends-on): Likewise.
* modules/file-has-acl (Depends-on): Likewise.
* modules/fstat (Depends-on): Likewise.
* modules/fstatat (Depends-on): Likewise.
* modules/glob (Depends-on): Likewise.
* modules/javacomp (Depends-on): Likewise.
* modules/linkat (Depends-on): Likewise.
* modules/mkdir (Depends-on): Likewise.
* modules/pt_chown (Depends-on): Likewise.
* modules/ptsname_r (Depends-on): Likewise.
* modules/readlinkat (Depends-on): Likewise.
* modules/rename (Depends-on): Likewise.
* modules/renameatu (Depends-on): Likewise.
* modules/tmpdir (Depends-on): Likewise.
* modules/utimens (Depends-on): Likewise.
* modules/relocatable-prog-wrapper (Depends-on): Add largefile.
* modules/same (Depends-on): Remove stat.

5 years agoacl-permissions: Improve autoconf macro.
Bruno Haible [Sun, 22 Mar 2020 12:08:53 +0000 (13:08 +0100)]
acl-permissions: Improve autoconf macro.

* m4/acl.m4 (gl_FUNC_ACL): Test the value of gl_need_lib_has_acl
more reliably.

5 years agofile-has-acl: Fix module description.
Bruno Haible [Sun, 22 Mar 2020 12:02:57 +0000 (13:02 +0100)]
file-has-acl: Fix module description.

* modules/file-has-acl (Files): Add lib/acl-internal.h, m4/acl.m4.
(Depends-on): Depend on acl-permissions unconditionally.

5 years agounlink: Ensure errno also on native Windows.
Bruno Haible [Sun, 22 Mar 2020 01:41:16 +0000 (02:41 +0100)]
unlink: Ensure errno also on native Windows.

* modules/unlink (Depends-on): Add malloc-posix.

5 years agounlink: fix malloc errno typo
Paul Eggert [Sat, 21 Mar 2020 23:13:28 +0000 (16:13 -0700)]
unlink: fix malloc errno typo

Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html
* lib/unlink.c (rpl_unlink): Don’t mask malloc errno.

5 years ago*printf-posix: Fix m4 error (regression from 2020-03-08).
Bruno Haible [Mon, 16 Mar 2020 13:14:52 +0000 (14:14 +0100)]
*printf-posix: Fix m4 error (regression from 2020-03-08).

* m4/printf.m4 (gl_SNPRINTF_DIRECTIVE_N): Enable interpretation of
brackets in AC_COMPILE_IFELSE invocation.

5 years agocrypto/af_alg, renameatu, same, term-style-control: Depend on fstat.
Bruno Haible [Sun, 8 Mar 2020 23:55:56 +0000 (00:55 +0100)]
crypto/af_alg, renameatu, same, term-style-control: Depend on fstat.

* modules/crypto/af_alg (Depends-on): Add fstat.
* modules/renameatu (Depends-on): Likewise.
* modules/same (Depends-on): Likewise.
* modules/term-style-control (Depends-on): Likewise.

5 years ago*printf-posix: Document why it's overridden on some glibc systems.
Bruno Haible [Sun, 8 Mar 2020 21:54:02 +0000 (22:54 +0100)]
*printf-posix: Document why it's overridden on some glibc systems.

Reported by Adrian Bunk <bunk@stusta.de> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00011.html>.

* doc/posix-functions/*printf.texi: Document the problem with the %n
directive on some glibc systems.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N): Adjust
the cross-compilation guesses accordingly.

5 years agoRevert my last commit, due to compilation errors.
Bruno Haible [Sat, 7 Mar 2020 19:44:47 +0000 (20:44 +0100)]
Revert my last commit, due to compilation errors.

5 years agoopen, openat: port to (O_RDWR | O_RDONLY) != 0
Paul Eggert [Sat, 7 Mar 2020 19:02:05 +0000 (11:02 -0800)]
open, openat: port to (O_RDWR | O_RDONLY) != 0

Potential portability problem reported by Dan Gohman in:
https://lists.gnu.org/r/bug-gnulib/2020-03/msg00000.html
* lib/open.c (open):
* lib/openat.c (rpl_openat):
Don’t assume O_RDONLY is disjoint from O_RDWR.

5 years agofindprog, relocatable-prog: Ignore directories during PATH search.
Bruno Haible [Sat, 7 Mar 2020 18:56:33 +0000 (19:56 +0100)]
findprog, relocatable-prog: Ignore directories during PATH search.

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

* lib/findprog.c (find_in_path): When the file found in a PATH element
is a directory, continue searching.
* lib/progreloc.c (maybe_executable): Likewise.

5 years agoopenat: Fix theoretically possible issue on GNU/Hurd.
Bruno Haible [Sat, 7 Mar 2020 17:35:25 +0000 (18:35 +0100)]
openat: Fix theoretically possible issue on GNU/Hurd.

Reported by Dan Gohman <sunfish@mozilla.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00000.html>.

* lib/openat.c (rpl_openat): When testing whether flags contains O_RDWR,
ignore the bits that are also set in O_RDONLY.