]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agomemset_explicit: new module
Paul Eggert [Mon, 28 Nov 2022 04:52:04 +0000 (20:52 -0800)]
memset_explicit: new module

* doc/posix-functions/memset_explicit.texi, lib/memset_explicit.c:
* m4/memset_explicit.m4, modules/memset_explicit:
* modules/memset_explicit-tests, tests/test-memset_explicit.c:
New files.
* lib/string.in.h (memset_explict): New decl.
* m4/string_h.m4 (gl_STRING_H, gl_STRING_H_REQUIRE_DEFAULTS)
(gl_STRING_H_DEFAULTS):
* modules/string (string.h):
Support memset_explicit.

2 years agoexplicit_bzero: add poison
Paul Eggert [Mon, 28 Nov 2022 01:15:24 +0000 (17:15 -0800)]
explicit_bzero: add poison

* m4/string_h.m4 (gl_STRING_H): Poison explicit_bzero.
This was inadvertently omitted when explicit_bzero was added.

2 years agobootstrap: Fix --help output.
Arsen Arsenović [Sun, 27 Nov 2022 19:45:06 +0000 (20:45 +0100)]
bootstrap: Fix --help output.

* build-aux/bootstrap (usage): Regenerate.

2 years agoexplicit_bzero: work with gcc -std=c99
Paul Eggert [Sun, 27 Nov 2022 17:59:32 +0000 (09:59 -0800)]
explicit_bzero: work with gcc -std=c99

* lib/explicit_bzero.c (explicit_bzero) [__GNUC__ && !__clang__]:
Use __asm__ instead of asm.

2 years agoPrefer "kill -INT" to killing with a number
Paul Eggert [Sat, 26 Nov 2022 18:43:24 +0000 (10:43 -0800)]
Prefer "kill -INT" to killing with a number

* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK):
* tests/test-login_tty.c (main):
* tests/test-pthread_sigmask1.c (main):
* tests/test-sigprocmask.c (main):
Prefer "kill -INT" to "kill -N" where N is SIGINT’s value.
Don’t assume pid_t fits in int.

2 years agoIn 'trap' commands, prefer symbolic to numeric signal names.
Bruno Haible [Sat, 26 Nov 2022 14:25:44 +0000 (15:25 +0100)]
In 'trap' commands, prefer symbolic to numeric signal names.

Reported by Mike Fulton <fultonm@ca.ibm.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00130.html>.

* gnulib-tool: Use symbolic signal names.
* posix-modules: Likewise.
* MODULES.html.sh: Likewise.
* build-aux/bootstrap (prepare_GNULIB_SRCDIR): Likewise.
* build-aux/csharpcomp.sh.in: Likewise.
* build-aux/gnu-web-doc-update: Likewise.
* top/autogen.sh: Likewise.
* top/bootstrap-funclib.sh: Likewise.
* top/gitsub.sh: Likewise.
* lib/t-idcache: Likewise.
* tests/havelib/rpath-1: Likewise.
* tests/havelib/rpath-2_a: Likewise.
* tests/havelib/rpath-2_b: Likewise.
* tests/havelib/rpath-3_a: Likewise.
* tests/havelib/rpath-3_b: Likewise.
* tests/init.sh: Likewise.
* tests/test-binary-io.sh: Likewise.
* tests/test-c-stack.sh: Likewise.
* tests/test-c-stack2.sh: Likewise.
* tests/test-dprintf-posix.sh: Likewise.
* tests/test-fpending.sh: Likewise.
* tests/test-fprintf-posix.sh: Likewise.
* tests/test-lseek.sh: Likewise.
* tests/test-printf-posix.sh: Likewise.
* tests/test-select-in.sh: Likewise.
* tests/test-select-out.sh: Likewise.
* tests/test-sigpipe.sh: Likewise.
* tests/test-tsearch.sh: Likewise.
* tests/test-update-copyright.sh: Likewise.
* tests/test-vdprintf-posix.sh: Likewise.
* tests/test-vfprintf-posix.sh: Likewise.
* tests/test-vprintf-posix.sh: Likewise.
* tests/test-xprintf-posix.sh: Likewise.
* tests/uniwidth/test-uc_width2.sh: Likewise.

2 years agoposix_spawn-internal: Avoid warning on macOS.
Bruno Haible [Sun, 20 Nov 2022 11:47:20 +0000 (12:47 +0100)]
posix_spawn-internal: Avoid warning on macOS.

Suggested by Minsoo Choo in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00114.html>.

* lib/spawni.c: Ignore -Wdeprecated-declarations warnings.

2 years agoposix_spawn tests: Fix compilation error (regression 2022-09-14).
Bruno Haible [Sun, 20 Nov 2022 10:09:19 +0000 (11:09 +0100)]
posix_spawn tests: Fix compilation error (regression 2022-09-14).

* modules/posix_spawn-tests (Makefile.am): Augment DEFS, to define
EXEEXT.

2 years agoparse-datetime: improve doc formatting, timeliness
Paul Eggert [Tue, 15 Nov 2022 02:36:41 +0000 (21:36 -0500)]
parse-datetime: improve doc formatting, timeliness

* doc/parse-datetime.texi: Use @samp and @code in menus
for consistenty with how the Coreutils manual will do
this sort of thing.  Update examples to this year.

2 years agoautoupdate
Paul Eggert [Sun, 13 Nov 2022 18:44:49 +0000 (10:44 -0800)]
autoupdate

2 years agoautoupdate
Karl Berry [Sun, 13 Nov 2022 15:53:36 +0000 (07:53 -0800)]
autoupdate

2 years agovc-list-files-tests: Avoid OpenPGP private key operations.
Simon Josefsson [Sun, 13 Nov 2022 10:50:51 +0000 (11:50 +0100)]
vc-list-files-tests: Avoid OpenPGP private key operations.

* tests/test-vc-list-files-git.sh (GIT_CONFIG_GLOBAL): Set it to /dev/null.

2 years agoautoupdate
Karl Berry [Tue, 8 Nov 2022 21:39:40 +0000 (13:39 -0800)]
autoupdate

2 years agoautoupdate
Karl Berry [Sun, 6 Nov 2022 14:13:58 +0000 (06:13 -0800)]
autoupdate

2 years agodynarray: Rename to glibc-internal/dynarray.
Bruno Haible [Thu, 3 Nov 2022 12:32:42 +0000 (13:32 +0100)]
dynarray: Rename to glibc-internal/dynarray.

* modules/glibc-internal/dynarray: Renamed from modules/dynarray.
* modules/glibc-internal/dynarray-tests: Renamed from
modules/dynarray-tests.
* modules/regex (Depends-on): Update.
* NEWS: Mention this change and the previous one.

2 years agoscratch_buffer: Rename to glibc-internal/scratch_buffer.
Bruno Haible [Thu, 3 Nov 2022 12:30:04 +0000 (13:30 +0100)]
scratch_buffer: Rename to glibc-internal/scratch_buffer.

* modules/glibc-internal/scratch_buffer: Renamed from
modules/scratch_buffer.
* modules/glibc-internal/scratch_buffer-tests: Renamed from
modules/scratch_buffer-tests.
* modules/canonicalize (Depends-on): Update.
* modules/canonicalize-lgpl (Depends-on): Likewise.
* modules/glob (Depends-on): Likewise.

2 years agodoc: mention macOS war on sprintf
Paul Eggert [Thu, 3 Nov 2022 18:43:45 +0000 (11:43 -0700)]
doc: mention macOS war on sprintf

* doc/posix-functions/sprintf.texi, doc/posix-functions/vsnprintf.texi:
Mention that these functions are deprecated.

2 years agoscratch_buffer: Document last change.
Bruno Haible [Thu, 3 Nov 2022 02:17:37 +0000 (03:17 +0100)]
scratch_buffer: Document last change.

* NEWS: Mention last change.

2 years agoscratch_buffer: adjust to glibc changes
Paul Eggert [Thu, 3 Nov 2022 01:14:15 +0000 (18:14 -0700)]
scratch_buffer: adjust to glibc changes

Problem reported by Karl Berry in:
https://lists.gnu.org/r/bug-gnulib/2022-11/msg00004.html
* build-aux/depcomp, doc/make-stds.texi, lib/malloc/scratch_buffer.h:
Autoupdate.
* build-aux/install-reloc (func_create_wrapper):
Omit removed file scratch_buffer_dupfree.c.
* config/srclist.txt: Remove lib/malloc/scratch_buffer_dupfree.c
* lib/canonicalize-lgpl.c: Merge changes from glibc through its
commit ef0700004bf0dccf493a5e8e21f71d9e7972ea9f dated 2022-07-05
11:04:45 +0200.
(__strdup) [!_LIBC]: New macro.
(struct realpath_bufs): New type.
(realpath_stk): Use it as the extra argument.  All uses changed.
No longer any need for noinline or GCC_BOGUS_WRETURN_LOCAL_ADDR.
* lib/canonicalize.c (struct realpath_bufs)
(canonicalize_filename_mode_stk): Likewise.
* lib/malloc/scratch_buffer_dupfree.c:
Remove, since it was removed in glibc.
* lib/scratch_buffer.h (scratch_buffer_dupfree) [0]:
(__libc_scratch_buffer_dupfree): Remove decls.
* modules/relocatable-prog-wrapper (Files):
* modules/scratch_buffer (Files, lib_SOURCES):
Remove lib/malloc/scratch_buffer_dupfree.c.

2 years agorelocatable-script: Relax license.
Bruno Haible [Tue, 1 Nov 2022 22:23:16 +0000 (23:23 +0100)]
relocatable-script: Relax license.

* modules/relocatable-script (License): Change to GPLv2+.
* build-aux/relocatable.sh.in: Change copyright header to GPLv2+.

2 years agoautoupdate
Karl Berry [Tue, 1 Nov 2022 20:49:33 +0000 (13:49 -0700)]
autoupdate

2 years agomaintainer-makefile: Fix last sc_indent commit.
Simon Josefsson [Tue, 1 Nov 2022 08:09:02 +0000 (09:09 +0100)]
maintainer-makefile: Fix last sc_indent commit.

* top/maint.mk (sc_indent): Don't use grep -q.
Suggested by Bruno Haible.

2 years agomaintainer-makefile: Add syntax-check rule for unportable 'grep -q'.
Simon Josefsson [Tue, 1 Nov 2022 08:06:56 +0000 (09:06 +0100)]
maintainer-makefile: Add syntax-check rule for unportable 'grep -q'.

* top/maint.mk (sc_unportable_grep_q): Add.

2 years agomaintainer-makefile: Fix Apple Xcode 'make syntax-check'.
Simon Josefsson [Mon, 31 Oct 2022 08:42:42 +0000 (09:42 +0100)]
maintainer-makefile: Fix Apple Xcode 'make syntax-check'.

* top/maint.mk (sc_indent): Don't use non-GNU indent.

2 years agothread: pacify gcc -Wbad-function-cast
Paul Eggert [Sun, 30 Oct 2022 19:39:08 +0000 (12:39 -0700)]
thread: pacify gcc -Wbad-function-cast

* lib/glthread/thread.h (gl_thread_self_pointer): With POSIX
threads, cast the call to gl_thread_t before casting to void *.

2 years agotest-getlogin: pacify gcc -Wshadow
Paul Eggert [Sun, 30 Oct 2022 19:29:26 +0000 (12:29 -0700)]
test-getlogin: pacify gcc -Wshadow

* tests/test-getlogin.h (test_getlogin_result): Rename local.

2 years agogendocs: Output timestamp in English.
Simon Josefsson [Tue, 25 Oct 2022 21:39:15 +0000 (23:39 +0200)]
gendocs: Output timestamp in English.

* build-aux/gendocs.sh (SETLANG): Add LC_TIME= for "date".

2 years agoassert-h: Make static_assert work on Solaris 11.4.
Bruno Haible [Sun, 23 Oct 2022 14:43:06 +0000 (16:43 +0200)]
assert-h: Make static_assert work on Solaris 11.4.

* m4/assert_h.m4 (gl_ASSERT_H): After including <assert.h>, on Solaris,
redefine static_assert.

2 years agogetdelim: Work around buggy implementation on macOS 10.13.
Bruno Haible [Mon, 17 Oct 2022 00:44:54 +0000 (02:44 +0200)]
getdelim: Work around buggy implementation on macOS 10.13.

* doc/posix-functions/getdelim.texi: Mention the macOS bug.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Let the "checking for working
getdelim function" test answer 'no' on macOS.

2 years agoUpdate to Unicode 15.0.0.
Bruno Haible [Sat, 15 Oct 2022 22:46:24 +0000 (00:46 +0200)]
Update to Unicode 15.0.0.

* lib/gen-uni-tables.c (is_property_default_ignorable_code_point):
Exclude 0x13439..0x1343F.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0ECE, 0x10EFD..0x10EFF, 0x11241, 0x11F00..0x11F01, 0x11F36..0x11F3A,
0x11F40, 0x11F42, 0x13439..0x13440, 0x13447..0x13455, 0x1E08F,
0x1E4EC..0x1E4EF.

* All the affected modules: Bump required libunistring version.

2 years agogen-uni-tables: Temporarily revert last change.
Bruno Haible [Sat, 15 Oct 2022 17:59:51 +0000 (19:59 +0200)]
gen-uni-tables: Temporarily revert last change.

* lib/gen-uni-tables.c: Include <stdbool.h>, unless the C compiler
advertises compliance to ISO C 23.

2 years agodoc: improve intprops doc
Paul Eggert [Thu, 13 Oct 2022 00:18:20 +0000 (17:18 -0700)]
doc: improve intprops doc

* doc/intprops.texi: Tighten up wording, by saying that macros
"yield 1 if X, 0 otherwise" rather than the weaker "yield 1 if X".
Say "yield" rather than "return" since the macros are not
functions.  Say "1" and "0" rather than "true" and "false" since
the macros yield int.  Say that stdckdint.h is the standard
alternative to the _WRAPV macros.  Mention another source of
problems with the _OVERFLOW macros.

2 years agoautoupdate
Karl Berry [Wed, 12 Oct 2022 14:08:25 +0000 (07:08 -0700)]
autoupdate

2 years agotests: prefer stdckdint to intprops
Paul Eggert [Tue, 11 Oct 2022 01:45:03 +0000 (18:45 -0700)]
tests: prefer stdckdint to intprops

* modules/chown-tests, modules/fchownat-tests:
* modules/fdutimensat-tests, modules/futimens-tests:
* modules/lchown-tests, modules/stat-time-tests:
* modules/utime-tests, modules/utimens-tests:
* modules/utimensat-tests:
(Depends on): Depend on stdckint, not intprops.
* tests/nap.h: Include stdckdint.h, not intprops.h.
All macro uses changed.

2 years agostat-time: prefer stdckdint to intprops
Paul Eggert [Tue, 11 Oct 2022 01:26:05 +0000 (18:26 -0700)]
stat-time: prefer stdckdint to intprops

* lib/stat-time.h: Include stdckdint.h instead of intprops.h.
(stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
* modules/stat-time (Depends-on): Depend on stdckdint, not intprops.

2 years agoxalloc: remove stray includes + dependencies
Paul Eggert [Tue, 11 Oct 2022 01:17:02 +0000 (18:17 -0700)]
xalloc: remove stray includes + dependencies

These used to be needed, but are not needed now.
* lib/xalloc.h: Do not include stdlib.h.
[GNULIB_XALLOC]: Do not include "intprops.h".
* lib/xmalloc.c: Include stdint.h here instead, for SIZE_MAX.
* modules/xalloc-die, modules/xvasprintf (Depends-on): Remove stdint.

2 years agoautoupdate
Karl Berry [Sat, 8 Oct 2022 15:10:14 +0000 (08:10 -0700)]
autoupdate

2 years agoassert-h: suppress Apple clang 13 false alarms
Paul Eggert [Sat, 1 Oct 2022 00:35:18 +0000 (17:35 -0700)]
assert-h: suppress Apple clang 13 false alarms

* m4/assert_h.m4 (gl_ASSERT_H): Suppress bogus warnings from Apple
clang 13 (clang-1300.0.29.30).  Problem privately reported by
Mattias Engdegård for GNU Emacs.

2 years agolargefile: fix detection of time_t size on mingw32
Daiki Ueno [Mon, 26 Sep 2022 04:48:42 +0000 (13:48 +0900)]
largefile: fix detection of time_t size on mingw32

* modules/largefile (configure.ac-early): Ensure gl_YEAR2038_EARLY
is invoked before gl_YEAR2038_BODY.

2 years agofts: fix errno handling if dirfd fails
Paul Eggert [Mon, 26 Sep 2022 01:33:49 +0000 (18:33 -0700)]
fts: fix errno handling if dirfd fails

* lib/fts.c (fts_build): Use proper errno if dirfd failed.
Although I don’t know of any platform where dirfd can fail here,
we might as well get it right.

2 years agostdbool: Mostly revert last patch.
Bruno Haible [Sun, 25 Sep 2022 14:38:19 +0000 (16:38 +0200)]
stdbool: Mostly revert last patch.

* m4/c-bool.m4 (gl_C_BOOL): If stdbool.h does not exist, just err out.
* modules/stdbool (Files): Remove m4/stdbool.m4.

2 years agostdbool: Don't #include a gnulib-generated stdbool.h from config.h.
Bruno Haible [Sat, 24 Sep 2022 21:42:44 +0000 (23:42 +0200)]
stdbool: Don't #include a gnulib-generated stdbool.h from config.h.

* m4/c-bool.m4 (gl_C_BOOL): Check for stdbool.h and for _Bool. If
stdbool.h does not exist, don't #include <stdbool.h> but instead put the
substitute code into config.h.

2 years agostdalign: Don't #include a gnulib-generated stdalign.h from config.h.
Bruno Haible [Sat, 24 Sep 2022 17:56:31 +0000 (19:56 +0200)]
stdalign: Don't #include a gnulib-generated stdalign.h from config.h.

* m4/stdalign.m4 (gl_STDALIGN_H): Check for stdalign.h. If it does not
exist, don't #include <stdalign.h> but instead put the substitute code
into config.h.

2 years agostdalign: Fix compilation error with MSVC in C++ mode.
Bruno Haible [Sat, 24 Sep 2022 22:38:15 +0000 (00:38 +0200)]
stdalign: Fix compilation error with MSVC in C++ mode.

* lib/stdalign.in.h: Treat MSVC in C++ mode like C++11 compliant
compilers.
* tests/test-stdalign-c++.cc: Include some other header files.

2 years agostdalign: Avoid namespace pollution.
Bruno Haible [Sat, 24 Sep 2022 22:23:20 +0000 (00:23 +0200)]
stdalign: Avoid namespace pollution.

* lib/stdalign.in.h (_GL_STDALIGN_NEEDS_STDDEF): New macro.
Include <stddef.h> only when needed.

2 years agowarnings, manywarnings: Doc fixes.
Simon Josefsson [Fri, 23 Sep 2022 07:06:22 +0000 (09:06 +0200)]
warnings, manywarnings: Doc fixes.

* doc/manywarnings.texi (manywarnings): Improve usage instruction.
Start list of comments on particular warning flags, based on
comment from Paul Eggert <eggert@cs.ucla.edu>.
* doc/warnings.texi (warnings): Mention that it is often used with manywarnings.

2 years agoautoupdate
Karl Berry [Thu, 22 Sep 2022 14:22:59 +0000 (07:22 -0700)]
autoupdate

2 years agoassert-h: suppress clang false alarms
Paul Eggert [Wed, 21 Sep 2022 23:37:37 +0000 (16:37 -0700)]
assert-h: suppress clang false alarms

Suppress scads of annoying warnings from clang version 14.0.5
(Fedora 14.0.5-1.fc36) of the form "warning: '_Static_assert' with
no message is a C2x extension [-Wc2x-extensions]",
by refusing to use single-arg static_assert with older clang.
* m4/assert_h.m4 (gl_ASSERT_H): Turn -Wc2x-extensions from a
warning into an error when testing static_assert, so that the
annoying diagnostic causes the test to fail, which causes assert.h
to be replaced in a way that suppresses the diagnostic during
the real build.

2 years agoAdd another helper script for creating testdirs.
Bruno Haible [Tue, 20 Sep 2022 22:29:05 +0000 (00:29 +0200)]
Add another helper script for creating testdirs.

* all-modules: New file, based on posix-modules.

2 years agosnippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.
Bruno Haible [Tue, 20 Sep 2022 21:31:19 +0000 (23:31 +0200)]
snippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.

* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Use the clang command-line
option that disables implicit built-in function declarations in clang.

2 years agostdbool, stdbool-c99 tests: Fix compilation error with clang/MSVC.
Bruno Haible [Mon, 19 Sep 2022 19:20:33 +0000 (21:20 +0200)]
stdbool, stdbool-c99 tests: Fix compilation error with clang/MSVC.

* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.

2 years agostdbool: omit ‘#undef true’
Paul Eggert [Sun, 18 Sep 2022 18:26:36 +0000 (11:26 -0700)]
stdbool: omit ‘#undef true’

This is mostly just simplification.
* m4/c-bool.m4 (gl_C_BOOL): Test all preprocessors when
!HAVE_C_BOOL, not merely __SUNPRO_CC.  Use the slightly
more-elegant ‘!true’ instead of ‘true == 1’; this shouldn’t matter
in practice and if it does matter we want to know about it anyway.
Remove an unnecessary ‘#undef true’ that is simply commented out
by ‘configure’; again, if true is already #defined to be 0 the
system is so messed up we want to know about it anyway.

2 years agostdbool: Ensure that 'true' can be used in the preprocessor.
Bruno Haible [Sun, 18 Sep 2022 16:47:22 +0000 (18:47 +0200)]
stdbool: Ensure that 'true' can be used in the preprocessor.

* m4/c-bool.m4 (gl_C_BOOL): With Sun C++, redefine 'true' if it does not
evaluate to 1 in the preprocessor.

2 years agostdbool-c99: Ensure that 'true' can be used in the preprocessor.
Bruno Haible [Sun, 18 Sep 2022 16:45:39 +0000 (18:45 +0200)]
stdbool-c99: Ensure that 'true' can be used in the preprocessor.

* lib/stdbool.in.h (true): Redefine if it does not evaluate to 1 in the
preprocessor.

2 years agoautoupdate
Karl Berry [Sun, 18 Sep 2022 15:58:44 +0000 (08:58 -0700)]
autoupdate

2 years agouni{case,ctype,gbrk,str}/base: Fix installed .h file (regr. 2022-09-10).
Bruno Haible [Sun, 18 Sep 2022 13:33:09 +0000 (15:33 +0200)]
uni{case,ctype,gbrk,str}/base: Fix installed .h file (regr. 2022-09-10).

* lib/unicase.in.h: Do include <stdbool.h>.
* lib/unictype.in.h: Likewise.
* lib/unigbrk.in.h: Likewise.
* lib/unistr.in.h: Likewise.

2 years agosignal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
Bruno Haible [Sun, 18 Sep 2022 12:41:20 +0000 (14:41 +0200)]
signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.

* lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
<pthread.h> on OpenBSD ≥ 5.1.

2 years agoexplicit_bzero-tests: robustify a bit
Paul Eggert [Sun, 18 Sep 2022 02:59:26 +0000 (19:59 -0700)]
explicit_bzero-tests: robustify a bit

This is mostly to suppress GCC warnings, though I suppose it
might also improve the test.
* tests/test-explicit_bzero.c: Do not ignore -Wmaybe-uninitialized,
as this warning should no longer be generated given the other changes.
(test_heap): ASSERT that malloc succeeds, to suppress any GCC
warning about relying on malloc succeeding.  Declare addr to be
volatile, so that GCC does not deduce that it is heapbuf in
disguise and diagnose using it after freeing it.
(do_secret_stuff): Declare more things to be volatile, to avoid
optimizations that might disturb the stack and/or mess up the test
in other ways.  Pass last_stackbuf address as a parameter rather
than having last_stackbuf be static, to avoid GCC warning about
assigning address of a local to a static; all callers changed.

2 years agowchar: Fix compilation errors in C++ mode on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 01:05:21 +0000 (03:05 +0200)]
wchar: Fix compilation errors in C++ mode on Solaris 11.3.

* lib/wchar.in.h (wcsnlen, wcpcpy, wcpncpy, wcscasecmp, wcsncasecmp,
wcsdup): Force declaration in C++ mode on Solaris (which does not
declare these functions in the global namespace).

2 years agoswab: Fix compilation error with Sun C++ on Solaris 11.3.
Bruno Haible [Sun, 18 Sep 2022 00:32:13 +0000 (02:32 +0200)]
swab: Fix compilation error with Sun C++ on Solaris 11.3.

* lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
not under Solaris 10, test also __XOPEN_OR_POSIX.

2 years agotime C++ tests: Fix link error on CentOS 5.
Bruno Haible [Sat, 17 Sep 2022 19:31:53 +0000 (21:31 +0200)]
time C++ tests: Fix link error on CentOS 5.

* modules/time-c++-tests (Makefile.am): Link test-time-c++ against
$(LIB_CLOCK_GETTIME).

2 years agoautoupdate
Karl Berry [Fri, 16 Sep 2022 15:18:31 +0000 (08:18 -0700)]
autoupdate

2 years agotime: Fix compilation errors with clang/MSVC.
Bruno Haible [Wed, 14 Sep 2022 22:50:41 +0000 (00:50 +0200)]
time: Fix compilation errors with clang/MSVC.

* m4/time_h.m4 (gl_TIME_H): Test whether asctime_r and ctime_r are
declared.
* lib/time.in.h (asctime_r, ctime_r): Skip _GL_WARN_ON_USE invocations
when these functions are not declared.

2 years agoverify: Avoid syntax error due to static_assert with clang in C++ mode.
Bruno Haible [Wed, 14 Sep 2022 20:21:47 +0000 (22:21 +0200)]
verify: Avoid syntax error due to static_assert with clang in C++ mode.

* lib/verify.h (static_assert): Don't define in clang C++ 6 or newer.
* m4/assert_h.m4 (gl_ASSERT_H): If we don't need to define static_assert
with clang in C++ mode, don't include <assert.h>.

2 years agoassert-h: work around include confusion
Paul Eggert [Wed, 14 Sep 2022 18:44:19 +0000 (13:44 -0500)]
assert-h: work around include confusion

* m4/assert_h.m4 (gl_ASSERT_H): Arrange for <config.h> to not
include <assert.h> if assert is already defined.  This works
around bugs in packages that mistakenly include <config.h> after
including <assert.h> (typically due to double-inclusion of
<config.h>).  Found in coreutils, which I plan to fix.

2 years agostdbool: depend on C99
Paul Eggert [Wed, 14 Sep 2022 18:40:37 +0000 (13:40 -0500)]
stdbool: depend on C99

Record that stdbool depends on C99 these days.
This matters only for ancient compilers that need special
flags to support C99 features.
* modules/stdbool (Depends-on): Add c99.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14 in C++.
Bruno Haible [Wed, 14 Sep 2022 16:08:10 +0000 (18:08 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14 in C++.

* lib/verify.h (static_assert): For MSVC in C++ mode, use a definition
that supports both the two-arguments and the one-argument syntax.

2 years agoposix_spawn-* tests: Fix test failure on mingw when libtool is in use.
Bruno Haible [Wed, 14 Sep 2022 13:12:18 +0000 (15:12 +0200)]
posix_spawn-* tests: Fix test failure on mingw when libtool is in use.

* tests/test-posix_spawn-inherit0.c (CHILD_PROGRAM_FILENAME): Add the
EXEEXT suffix.
* tests/test-posix_spawn-inherit1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open2.c (CHILD_PROGRAM_FILENAME): Likewise.

2 years agoverify: Avoid syntax error due to static_assert with MSVC 14.
Bruno Haible [Wed, 14 Sep 2022 11:35:14 +0000 (13:35 +0200)]
verify: Avoid syntax error due to static_assert with MSVC 14.

* lib/verify.h (_Static_assert): Pass only the first argument to
_GL_VERIFY.

2 years agoverify: treat GNU C++ 6 like recent C++
Paul Eggert [Wed, 14 Sep 2022 04:01:53 +0000 (23:01 -0500)]
verify: treat GNU C++ 6 like recent C++

* lib/verify.h (_GL_VERIFY):
* m4/assert_h.m4 (gl_ASSERT_H):
If we check __cpp_static_assert < 200410, also check __GNUG__ < 6,
for consistency with the previous change.

2 years agoverify: Avoid syntax error due to static_assert with GNU C++ 6.x.
Bruno Haible [Wed, 14 Sep 2022 01:04:10 +0000 (03:04 +0200)]
verify: Avoid syntax error due to static_assert with GNU C++ 6.x.

* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.

2 years agoKeep ChangeLog entries order in sync with the git commit order.
Bruno Haible [Tue, 13 Sep 2022 23:17:54 +0000 (01:17 +0200)]
Keep ChangeLog entries order in sync with the git commit order.

2 years agostdalign: prefer to not include <stdalign.h>
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
stdalign: prefer to not include <stdalign.h>

* lib/alignalloc.c, lib/argp-parse.c, lib/fts.c, lib/md4.c, lib/md5.c:
* lib/rawmemchr.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/sm3.c:
* lib/sys_socket.in.h:
In C23, <stdalign.h> is a no-op, so don’t include it.

2 years agostdalign: alignas and alignof are C23 keywords
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
stdalign: alignas and alignof are C23 keywords

* m4/stdalign.m4 (gl_STDALIGN_H): Check also whether
alignas and alignof are keywords and so don’t need stdalign.h,
and define HAVE_C_ALIGNASOF if so.
If not, arrange for config.h to #define alignas and alignof
by including <stdalign.h>.
* modules/stdalign: No need to include <stdalign.h>.
* tests/test-stdalign.c: Do not include stdalign.h.

2 years agoassert-h: prefer to ‘verify’
Paul Eggert [Tue, 13 Sep 2022 22:29:36 +0000 (17:29 -0500)]
assert-h: prefer to ‘verify’

Where it’s easy, prefer ‘static_assert’ to ‘verify’,
as this simplifies the source by removing the need to
include verify.h.  Keep using ‘verify’ if verify.h
is used for other reasons, or if code is shared with glibc.
* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
* tests/test-intprops.c, tests/test-libgmp.c:
* tests/test-limits-h.c, tests/test-locale.c:
* tests/test-pthread.c, tests/test-round2.c:
* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
* tests/test-wchar.c:
Prefer static_assert to verify, and stop including verify.h.
* lib/stat.c: Don’t include verify.h (this include was unnecessary).
* modules/alignalloc, modules/alignof-tests, modules/argmatch:
* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
* modules/c32isgraph, modules/c32islower, modules/c32isprint:
* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
* modules/intprops-tests, modules/libgmp-tests:
* modules/limits-h-tests, modules/locale-tests, modules/malloca:
* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
* modules/rawmemchr, modules/relocatable-prog-wrapper:
* modules/round-tests, modules/roundf-tests, modules/sleep:
* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
* modules/strerror, modules/string-tests, modules/strtoimax:
* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
* modules/uchar-tests, modules/unistd-tests:
* 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/utimecmp, modules/vasnprintf, modules/wchar-tests:
Depend on assert-h, not verify.

2 years agoassert-h: static_assert is a keyword in C23
Paul Eggert [Tue, 13 Sep 2022 22:29:35 +0000 (17:29 -0500)]
assert-h: static_assert is a keyword in C23

* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
If not, arrange for config.h to #define static_assert
by including <assert.h>, and then do "#undef assert"
so that the assert macro still needs an explicit include.
This should be safe even on very old hosts, as assert.h
has been re-includable for decades.
* tests/tests-assert.c: New test.
* modules/assert-h-tests (Files, Makefile.am): Add it.

2 years agoPrefer talking about alignas than _Alignas.
Bruno Haible [Tue, 13 Sep 2022 20:18:37 +0000 (22:18 +0200)]
Prefer talking about alignas than _Alignas.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't mention _Alignas in a
comment.
* m4/stdalign.m4 (gl_STDALIGN_H): Likewise.

2 years agostdalign-tests: port to C23
Paul Eggert [Tue, 13 Sep 2022 17:56:56 +0000 (12:56 -0500)]
stdalign-tests: port to C23

* tests/test-stdalign.c: Do not test __alignas_is_defined,
_Alignof, or _Alignas as they are obsolescent.
Do not use __alignas_is_defined in C23 or later (or C++11 or later),
as it’s removed in C23.

2 years agosupersede: Avoid a failure when writing to /dev/null in Solaris zones.
Bruno Haible [Mon, 12 Sep 2022 08:49:25 +0000 (10:49 +0200)]
supersede: Avoid a failure when writing to /dev/null in Solaris zones.

* lib/supersede.c (open_supersede): Treat EACCES (seen on Solaris 11.3)
like EINVAL (seen on Illumos).

2 years agomaint: avoid unportable ERE \}
Paul Eggert [Sun, 11 Sep 2022 21:45:27 +0000 (16:45 -0500)]
maint: avoid unportable ERE \}

* top/maint.mk (sc_copyright_check):
Avoid unportable use of \} in ERE.

2 years agoverify: improve maint check
Paul Eggert [Sun, 11 Sep 2022 21:26:28 +0000 (16:26 -0500)]
verify: improve maint check

* top/maint.mk (sc_prohibit_verify_without_use):
Adjust re to match verify.h.

2 years agoverify: port better to C23
Paul Eggert [Sun, 11 Sep 2022 20:39:48 +0000 (15:39 -0500)]
verify: port better to C23

* lib/verify.h (_GL_VERIFY, static_assert):
If C23, use static_assert keyword; no macro.
This should simplify diagnostics and debugging.

2 years agoautoupdate
Karl Berry [Sun, 11 Sep 2022 14:56:05 +0000 (07:56 -0700)]
autoupdate

2 years agopipe-filter-gi: Fix test failure on native Windows.
Bruno Haible [Sun, 11 Sep 2022 00:53:07 +0000 (02:53 +0200)]
pipe-filter-gi: Fix test failure on native Windows.

* lib/pipe-filter-aux.h (write): Redefine on native Windows.

2 years agostdbool C++ tests: Fix compilation error with MSVC14 (regr. from today).
Bruno Haible [Sat, 10 Sep 2022 22:48:56 +0000 (00:48 +0200)]
stdbool C++ tests: Fix compilation error with MSVC14 (regr. from today).

* tests/test-stdbool-c++.cc (s): Choose field names that are not type
names.

2 years agoReorganize C++ tests for stdbool and stdbool-c99.
Bruno Haible [Sat, 10 Sep 2022 18:01:24 +0000 (20:01 +0200)]
Reorganize C++ tests for stdbool and stdbool-c99.

* tests/test-stdbool-c++.cc: Don't include <stdbool.h> if TEST_STDBOOL_H
is not defined. Add a couple of simple tests, from test-stdbool.c.
* tests/test-stdbool-c99-c++.cc: New file.
* modules/stdbool-c99-c++-tests: New file, based on
modules/stdbool-c++-tests.
* modules/stdbool-c99-tests (Depends-on): Add stdbool-c99-c++-tests.
Remove stdbool-c++-tests.
* modules/stdbool-tests (Depends-on): Add stdbool-c++-tests.

2 years agostdbool C++ tests: Fix for C++20.
Bruno Haible [Sat, 10 Sep 2022 17:18:05 +0000 (19:18 +0200)]
stdbool C++ tests: Fix for C++20.

* tests/test-stdbool-c++2.cc: Don't include <cstdbool> in C++20 or
newer.

2 years agouchar: Work around error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:56:14 +0000 (18:56 +0200)]
uchar: Work around error in C++ mode on AIX 7.2 with xlclang.

* lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
these as macros.
* doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.

2 years agoRely on new stdbool behavior
Paul Eggert [Sat, 10 Sep 2022 16:41:32 +0000 (11:41 -0500)]
Rely on new stdbool behavior

Prefer the C23 style to the C99 style,
since the stdbool module now supports C23.
* lib/acl-internal.h, lib/acl.h, lib/argmatch.c, lib/argmatch.h:
* lib/argp-help.c, lib/argv-iter.h, lib/asyncsafe-spin.c:
* lib/backup-internal.h, lib/backupfile.c, lib/base32.h:
* lib/base64.h, lib/basename-lgpl.c, lib/bitset/base.h:
* lib/c-ctype.h, lib/c-strcasestr.c, lib/canonicalize-lgpl.c:
* lib/canonicalize.c, lib/chdir-long.c, lib/chown.c:
* lib/classpath.h, lib/clean-temp-private.h:
* lib/clean-temp-simple.c, lib/clean-temp-simple.h:
* lib/clean-temp.c, lib/clean-temp.h, lib/cloexec.h:
* lib/close-stream.c, lib/closein.c, lib/closeout.c, lib/closeout.h:
* lib/csharpcomp.h, lib/csharpexec.h, lib/cycle-check.c:
* lib/cycle-check.h, lib/des.h, lib/dfa.h, lib/diffseq.h:
* lib/dirname.h, lib/exclude.c, lib/exclude.h, lib/execute.c:
* lib/execute.h, lib/execvpe.c, lib/fatal-signal.c, lib/fchdir.c:
* lib/file-set.h, lib/filevercmp.c, lib/findprog-in.c:
* lib/findprog.c, lib/findprog.h, lib/fma.c, lib/fnmatch.c:
* lib/fopen.c, lib/freadable.h, lib/freading.h, lib/freopen-safer.c:
* lib/fstrcmp.c, lib/fsusage.h, lib/fts.c, lib/fwritable.h:
* lib/fwriteerror.c, lib/fwriting.h, lib/gen-uni-tables.c:
* lib/getaddrinfo.c, lib/getcwd.c, lib/getloadavg.c:
* lib/getndelim2.c, lib/getpass.c, lib/getrandom.c:
* lib/git-merge-changelog.c, lib/gl_list.h, lib/gl_map.h:
* lib/gl_omap.h, lib/gl_oset.h, lib/gl_set.h, lib/glob.c:
* lib/glthread/cond.h, lib/hamt.h, lib/hard-locale.h:
* lib/hash-triple.h, lib/hash.h, lib/human.h, lib/i-ring.h:
* lib/isapipe.c, lib/javacomp.h, lib/javaexec.h, lib/javaversion.c:
* lib/lchown.c, lib/localeinfo.h, lib/localename.c:
* lib/long-options.h, lib/malloc/dynarray.h, lib/mbchar.h:
* lib/mbfile.h, lib/mbiter.h, lib/mbmemcasecoll.h, lib/mbscasestr.c:
* lib/mbsstr.c, lib/mbuiter.h, lib/mkdir-p.h, lib/modechange.h:
* lib/mountlist.h, lib/nanosleep.c, lib/nonblocking.h:
* lib/nstrftime.c, lib/openat.c, lib/openat.h, lib/os2-spawn.c:
* lib/parse-datetime.h, lib/pipe-filter-aux.c, lib/pipe-filter-gi.c:
* lib/pipe-filter-ii.c, lib/pipe-filter.h, lib/posixtm.h:
* lib/priv-set.c, lib/progreloc.c, lib/propername.c:
* lib/pthread-spin.c, lib/quotearg.c, lib/readtokens.c:
* lib/readtokens0.h, lib/readutmp.c, lib/regex-quote.h:
* lib/regex_internal.h, lib/relocwrapper.c, lib/rename.c:
* lib/renameatu.c, lib/rpmatch.c, lib/same.c, lib/same.h:
* lib/save-cwd.c, lib/savewd.c, lib/savewd.h, lib/spawn-pipe.h:
* lib/spawni.c, lib/stack.h, lib/stat.c, lib/stdckdint.in.h:
* lib/strcasestr.c, lib/strfmon_l.c, lib/striconveh.c:
* lib/striconveha.h, lib/string-buffer.h, lib/strptime.c:
* lib/strstr.c, lib/strtod.c, lib/supersede.h, lib/system-quote.c:
* lib/tempname.c, lib/term-style-control.c:
* lib/term-style-control.h, lib/textstyle.in.h, lib/time_rz.c:
* lib/tmpdir.c, lib/tmpdir.h, lib/tmpfile.c, lib/unicase.in.h:
* lib/unicase/caseprop.h, lib/unicase/invariant.h:
* lib/unicase/u16-casemap.c, lib/unicase/u16-ct-totitle.c:
* lib/unicase/u16-is-invariant.c, lib/unicase/u32-casemap.c:
* lib/unicase/u32-ct-totitle.c, lib/unicase/u32-is-invariant.c:
* lib/unicase/u8-casemap.c, lib/unicase/u8-ct-totitle.c:
* lib/unicase/u8-is-invariant.c, lib/unictype.in.h:
* lib/unigbrk.in.h, lib/unigbrk/u16-grapheme-breaks.c:
* lib/unigbrk/u32-grapheme-breaks.c:
* lib/unigbrk/u8-grapheme-breaks.c:
* lib/unigbrk/uc-grapheme-breaks.c, lib/uniname/uniname.c:
* lib/unistr.in.h, lib/unlinkdir.h, lib/userspec.h, lib/utime.c:
* lib/utimecmp.c, lib/utimens.c, lib/wait-process.h:
* lib/windows-cond.c, lib/windows-spawn.c, lib/windows-spawn.h:
* lib/windows-timedrwlock.c, lib/write-any-file.h, lib/xbinary-io.c:
* lib/xstrtod.h, lib/yesno.h:
* tests/nap.h, tests/qemu.h, tests/test-areadlink-with-size.c:
* tests/test-areadlink.c, tests/test-areadlinkat-with-size.c:
* tests/test-areadlinkat.c, tests/test-base32.c:
* tests/test-base64.c, tests/test-ceil2.c, tests/test-ceilf2.c:
* tests/test-chown.c, tests/test-dirname.c, tests/test-dup-safer.c:
* tests/test-dup3.c, tests/test-exclude.c:
* tests/test-execute-child.c, tests/test-execute-main.c:
* tests/test-execute-script.c, tests/test-explicit_bzero.c:
* tests/test-fchownat.c, tests/test-fcntl-safer.c:
* tests/test-fcntl.c, tests/test-fdutimensat.c:
* tests/test-filenamecat.c, tests/test-floor2.c:
* tests/test-floorf2.c, tests/test-fstatat.c, tests/test-fstrcmp.c:
* tests/test-futimens.c, tests/test-getlogin.h, tests/test-getopt.h:
* tests/test-hard-locale.c, tests/test-hash.c:
* tests/test-idpriv-drop.c, tests/test-idpriv-droptemp.c:
* tests/test-immutable.c, tests/test-intprops.c:
* tests/test-lchown.c, tests/test-link.c, tests/test-linkat.c:
* tests/test-lstat.c, tests/test-mbmemcasecmp.c:
* tests/test-mbmemcasecoll.c, tests/test-mkdir.c:
* tests/test-mkdirat.c, tests/test-mkfifo.c, tests/test-mkfifoat.c:
* tests/test-mknod.c, tests/test-nonblocking-pipe-child.c:
* tests/test-nonblocking-pipe-main.c:
* tests/test-nonblocking-socket-child.c:
* tests/test-nonblocking-socket-main.c, tests/test-open.c:
* tests/test-openat.c, tests/test-pipe.c, tests/test-pipe2.c:
* tests/test-poll.c, tests/test-posix_spawn-chdir.c:
* tests/test-posix_spawn-dup2-stdin.c:
* tests/test-posix_spawn-dup2-stdout.c:
* tests/test-posix_spawn-fchdir.c, tests/test-posix_spawn-open1.c:
* tests/test-posix_spawn-open2.c, tests/test-quotearg-simple.c:
* tests/test-quotearg.c, tests/test-readlink.c:
* tests/test-readlinkat.c, tests/test-readtokens.c:
* tests/test-rename.c, tests/test-renameat.c:
* tests/test-renameatu.c, tests/test-rmdir.c, tests/test-round2.c:
* tests/test-select.h, tests/test-spawn-pipe-child.c:
* tests/test-spawn-pipe-main.c, tests/test-spawn-pipe-script.c:
* tests/test-stack.c, tests/test-stat.c, tests/test-supersede.c:
* tests/test-symlink.c, tests/test-symlinkat.c:
* tests/test-system-quote-main.c:
* tests/test-term-style-control-hello.c:
* tests/test-term-style-control-yes.c, tests/test-timespec.c:
* tests/test-trunc2.c, tests/test-truncf2.c, tests/test-unlink.c:
* tests/test-unlinkat.c, tests/test-userspec.c, tests/test-utime.c:
* tests/test-utimens.c, tests/test-utimensat.c:
* tests/unictype/test-categ_byname.c:
* tests/unigbrk/test-uc-is-grapheme-break.c:
Don’t include stdbool.h.
* modules/acl, modules/xgetcwd:
Don’t depend on stdbool, as these modules don’t use bool.
* modules/argp, modules/bitset, modules/diffseq, modules/file-has-acl:
* modules/gen-uni-tables, modules/getrandom:
* modules/hash-triple-simple, modules/posix_spawn-internal:
* modules/strcasestr, modules/supersede, modules/system-quote:
* modules/uniconv/base, modules/uniname/uniname, modules/utime:
* modules/windows-timedrwlock:
Depend on stdbool, as these modules use bool.

2 years agostdbool: upgrade from C99 to C23
Paul Eggert [Sat, 10 Sep 2022 16:41:31 +0000 (11:41 -0500)]
stdbool: upgrade from C99 to C23

Change the stdbool module so that it now emulates C23.
The module now assumes C99.  The old module (which assumes
C89 and emulates C99) is still available  as stdbool-c99,
but is deprecated.
* tests/test-stdbool.c [TEST_STDBOOL_H]: Do not include stdbool.h.
(WORKING_BOOL): Depend on HAVE_C_BOOL, not __STDC_VERSION__.
* m4/c-bool.m4, modules/c-bool, modules/c-bool-tests:
* tests/test-c-bool.c: New files.

2 years agostring: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:20:58 +0000 (18:20 +0200)]
string: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/string.in.h (mbslen): Enable the C++ alias warning only on glibc
systems.

2 years agomath: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
Bruno Haible [Sat, 10 Sep 2022 16:03:02 +0000 (18:03 +0200)]
math: Fix compilation error in C++ mode on AIX 7.2 with xlclang.

* lib/math.in.h (cbrtl, copysignl, exp2l, expm1l, fmal, ilogbl, log1pl,
log2l, logbl, remainderl, rintl, roundl, truncl): Enable the C++ alias
warning only on glibc systems.

2 years agodoc: Mention the stable branches.
Bruno Haible [Sat, 10 Sep 2022 13:17:05 +0000 (15:17 +0200)]
doc: Mention the stable branches.

* doc/gnulib-readme.texi (High Quality): Add subsection
'Stable Branches'.
(Writing reliable code): Extracted from 'High Quality'. Mention also
-Wall and valgrind.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:31:20 +0000 (02:31 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/windows-spawn.h (DELAYED_DUP2_OLDFD, DELAYED_DUP2_NEWFD): New
macros.
(struct IHANDLE): Add a linked_fd field.
* lib/spawni.c (SPAWN_INTERNAL_OPTIMIZE_DUPLICATEHANDLE): New macro.
(do_delayed_dup2, do_remaining_delayed_dup2): New functions.
(close_inheritable_handles): Don't close handles in DELAYED_DUP2_NEWFD
entries.
(do_close): Add a third parameter. Optimize delayed dup2 calls.
(do_open): Use do_close.
(do_dup2): Likewise. Prepare for optimizing the DuplicateHandle call.
(__spawni): Do the remaining delayed dup2 invocations after the loop
over the actions.

2 years agoposix_spawn-internal: Refactor.
Bruno Haible [Sat, 10 Sep 2022 00:30:14 +0000 (02:30 +0200)]
posix_spawn-internal: Refactor.

* lib/windows-spawn.h (struct IHANDLE): New type.
(struct inheritable_handles): Combine handles and flags into a single
array.
* lib/windows-spawn.c (init_inheritable_handles, compose_handles_block,
spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles, shrink_inheritable_handles,
do_open, do_dup2, do_close): Update.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:27:54 +0000 (02:27 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/spawni.c (open_handle): Return an inheritable HANDLE.
(do_open): Don't call DuplicateHandle. Remove curr_process parameter.
(__spawni): Update.

2 years agoposix_spawn-internal: Optimize DuplicateHandle calls on native Windows.
Bruno Haible [Sat, 10 Sep 2022 00:27:05 +0000 (02:27 +0200)]
posix_spawn-internal: Optimize DuplicateHandle calls on native Windows.

* lib/windows-spawn.h (KEEP_OPEN_IN_PARENT): New macro.
* lib/windows-spawn.c (init_inheritable_handles): When a handle is
already inheritable, don't bother duplicating it; instead, just mark it
as KEEP_OPEN_IN_PARENT.
* lib/spawni.c (shrink_inheritable_handles, close_inheritable_handles,
do_open, do_dup2, do_close): Don't close handles that are marked as
KEEP_OPEN_IN_PARENT.

2 years agoposix_spawn-internal: Don't lose flags while duplicating an fd.
Bruno Haible [Sat, 10 Sep 2022 00:26:18 +0000 (02:26 +0200)]
posix_spawn-internal: Don't lose flags while duplicating an fd.

* lib/spawni.c (do_dup2): Fix the flags of the new fd.

2 years agospawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).
Bruno Haible [Fri, 9 Sep 2022 14:49:10 +0000 (16:49 +0200)]
spawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).

* lib/windows-spawn.h (struct inheritable_handles): Widen the per-fd
flags from 8 bits to 16 bits.
(KEEP_OPEN_IN_CHILD): New macro.
(init_inheritable_handles): Change description of what it does when
duplicate == true.
* lib/windows-spawn.c (init_inheritable_handles): If duplicate == true,
add all fds to the array, regardless whether they are scheduled to be
preserved in the child process.
(compose_handles_block): Update.
(spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles): Update.
(shrink_inheritable_handles): Also close the handles not marked with
KEEP_OPEN_IN_CHILD.
(do_open, do_dup2): Mark the new fd with KEEP_OPEN_IN_CHILD.

2 years agoautoupate
Karl Berry [Fri, 9 Sep 2022 14:41:01 +0000 (07:41 -0700)]
autoupate