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

2 years agospawn-pipe: Fix possible hangs in programs that spawn several children.
Bruno Haible [Fri, 9 Sep 2022 13:14:45 +0000 (15:14 +0200)]
spawn-pipe: Fix possible hangs in programs that spawn several children.

* lib/spawn-pipe.c (create_pipe) [Unix]: Create the ifd[] and ofd[] file
descriptors with the close-on-exec flag set.

2 years agopipe-filter-gi tests: Fix long-standing failure on native Windows.
Bruno Haible [Tue, 6 Sep 2022 13:09:41 +0000 (15:09 +0200)]
pipe-filter-gi tests: Fix long-standing failure on native Windows.

* tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

2 years agoposix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.
Bruno Haible [Fri, 9 Sep 2022 12:26:54 +0000 (14:26 +0200)]
posix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.

* modules/posix_spawn_file_actions_addclose-tests (Files): Add
m4/musl.m4.

2 years agostdbool-tests: match stdbool
Paul Eggert [Fri, 9 Sep 2022 04:46:19 +0000 (23:46 -0500)]
stdbool-tests: match stdbool

* tests/test-stdbool.c: Omit test for
__bool_true_false_are_defined since AC_CHECK_HEADER_STDBOOL no
longer checks for this obsolescent macro.

2 years agomktime: back in sync with GNUlib
Paul Eggert [Fri, 9 Sep 2022 04:11:59 +0000 (23:11 -0500)]
mktime: back in sync with GNUlib

* config/srclist.txt: glibc has synced mktime from Gnulib.

2 years agoautoupdate
Paul Eggert [Fri, 9 Sep 2022 04:10:20 +0000 (23:10 -0500)]
autoupdate

2 years agoposix_spawn_file_actions_addclose tests: Avoid test failure on musl.
Bruno Haible [Wed, 7 Sep 2022 21:33:31 +0000 (23:33 +0200)]
posix_spawn_file_actions_addclose tests: Avoid test failure on musl.

Reported by Valery Ushakov <uwe@stderr.spb.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-09/msg00041.html>.

* modules/posix_spawn_file_actions_addclose-tests (configure.ac): Invoke
gl_MUSL_LIBC.
* tests/test-posix_spawn_file_actions_addclose.c (main): Skip one of the
tests on musl libc.

2 years agoautoupdate
Karl Berry [Tue, 6 Sep 2022 14:18:41 +0000 (07:18 -0700)]
autoupdate

2 years agognumakefile: Improve tarball reproducibility.
Simon Josefsson [Tue, 6 Sep 2022 12:32:05 +0000 (14:32 +0200)]
gnumakefile: Improve tarball reproducibility.

* top/GNUmakefile (TAR_OPTIONS): Add --sort=name.  Suggested by
Tzvetelin Katchov <katchov@gnu.org>.
* DEPENDENCIES: Mention tar 1.28 dependency.

2 years agopthread-h: Fix compilation error on mingw with --enable-threads=windows.
Bruno Haible [Mon, 5 Sep 2022 19:54:10 +0000 (21:54 +0200)]
pthread-h: Fix compilation error on mingw with --enable-threads=windows.

* lib/pthread.in.h: In C++ mode, if mingw's <pthread.h> has not been
used, import many pthread_* symbols from the GNULIB_NAMESPACE into the
global namespace.

2 years agoautoupdate
Karl Berry [Mon, 5 Sep 2022 14:55:49 +0000 (07:55 -0700)]
autoupdate

2 years agoFix various test link errors on MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:53:28 +0000 (01:53 +0200)]
Fix various test link errors on MSVC.

* modules/crypto/gc-arcfour-tests (Makefile.am): Link test-gc-arcfour
with $(LIB_GETRANDOM).
* modules/crypto/gc-arctwo-tests (Makefile.am): Link test-gc-arctwo with
$(LIB_GETRANDOM).
* modules/crypto/gc-des-tests (Makefile.am): Link test-gc-des with
$(LIB_GETRANDOM).
* modules/crypto/gc-hmac-md5-tests (Makefile.am): Link test-gc-hmac-md5
with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha1-tests (Makefile.am): Link
test-gc-hmac-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha256-tests (Makefile.am): Link
test-gc-hmac-sha256 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha512-tests (Makefile.am): Link
test-gc-hmac-sha512 with $(LIB_GETRANDOM).
* modules/crypto/gc-md2-tests (Makefile.am): Link test-gc-md2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md4-tests (Makefile.am): Link test-gc-md4 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md5-tests (Makefile.am): Link test-gc-md5 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-tests (Makefile.am): Link test-gc-pbkdf2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-sha1-tests (Makefile.am): Link
test-gc-pbkdf2-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-rijndael-tests (Makefile.am): Link test-gc-rijndael
with $(LIB_GETRANDOM).
* modules/crypto/gc-sha1-tests (Makefile.am): Link test-gc-sha1 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha256-tests (Makefile.am): Link test-gc-sha256 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha512-tests (Makefile.am): Link test-gc-sha512 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sm3-tests (Makefile.am): Link test-gc-sm3 with
$(LIB_GETRANDOM).
* modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with
$(LIB_GETRANDOM).
* modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ with
$(LIB_GETRANDOM).

2 years agocount-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.
Bruno Haible [Sun, 4 Sep 2022 23:34:36 +0000 (01:34 +0200)]
count-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.

* lib/count-leading-zeros.h: Correct syntax for #pragma intrinsic.
(COUNT_LEADING_ZEROS): Fix the return value.
(count_leading_zeros_ll): Use two _BitScanReverse invocations instead
of a _BitScanReverse64 invocation.

2 years agocount-trailing-zeros: Fix a link error on 32-bit MSVC.
Bruno Haible [Sun, 4 Sep 2022 23:29:26 +0000 (01:29 +0200)]
count-trailing-zeros: Fix a link error on 32-bit MSVC.

* lib/count-trailing-zeros.h: Correct syntax for #pragma intrinsic.
(count_trailing_zeros_ll): Use two _BitScanForward invocations instead
of a _BitScanForward64 invocation.

2 years agounictype/category-none tests: Fix a link error on MSVC.
Bruno Haible [Sun, 4 Sep 2022 22:31:33 +0000 (00:31 +0200)]
unictype/category-none tests: Fix a link error on MSVC.

* tests/unictype/test-categ_none.c (main): Disable the test on MSVC.

2 years agooset-c++: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 22:14:48 +0000 (00:14 +0200)]
oset-c++: Fix compilation error with MSVC 14.

* lib/gl_oset.hh: With MSVC, avoid 'friend'.

2 years agoglob tests: Fix link error on mingw.
Bruno Haible [Sun, 4 Sep 2022 22:02:44 +0000 (00:02 +0200)]
glob tests: Fix link error on mingw.

* modules/glob-tests (Makefile.am): Link test-glob with $(LIBINTL).

2 years agoautoupdate
Karl Berry [Sun, 4 Sep 2022 15:47:07 +0000 (08:47 -0700)]
autoupdate

2 years agotimespec_get: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 15:09:53 +0000 (17:09 +0200)]
timespec_get: Fix compilation error with MSVC 14.

* m4/gettime.m4 (gl_CHECK_FUNC_TIMESPEC_GET): New macro.
(gl_GETTIME): Use it instead of AC_CHECK_FUNCS_ONCE.
* m4/timespec_get.m4 (gl_FUNC_TIMESPEC_GET): Likewise.

2 years agostdbool: Fix compilation error in C++ mode with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:24:56 +0000 (16:24 +0200)]
stdbool: Fix compilation error in C++ mode with MSVC 14.

* lib/stdbool.in.h (_Bool, bool, false, true): In C++ mode with MSVC 14,
don't define these as macros.

2 years agofts: Fix compilation error with MSVC 14.
Bruno Haible [Sun, 4 Sep 2022 14:14:17 +0000 (16:14 +0200)]
fts: Fix compilation error with MSVC 14.

* lib/fts.c (S_IFBLK): Add fallback definition.

2 years agolstat: Fix compilation error in C++ mode on mingw.
Bruno Haible [Sun, 4 Sep 2022 14:06:37 +0000 (16:06 +0200)]
lstat: Fix compilation error in C++ mode on mingw.

* lib/sys_stat.h (lstat): Move declaration after the declaration of
'stat'.

2 years agopselect: Fix compilation error in C++ mode on mingw.
Bruno Haible [Sun, 4 Sep 2022 13:51:29 +0000 (15:51 +0200)]
pselect: Fix compilation error in C++ mode on mingw.

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

2 years agonanosleep: Work around bug on newer 32-bit mingw.
Bruno Haible [Sun, 4 Sep 2022 11:26:19 +0000 (13:26 +0200)]
nanosleep: Work around bug on newer 32-bit mingw.

* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Test for 32-bit mingw bug.
* tests/test-nanosleep.c (main): Add another test.
* doc/posix-functions/nanosleep.texi: Mention the mingw bug.

2 years agofmal: Work around glibc 2.17 bug on x86_64.
Bruno Haible [Sun, 4 Sep 2022 02:48:31 +0000 (04:48 +0200)]
fmal: Work around glibc 2.17 bug on x86_64.

* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Test against bug seen on glibc 2.17
x86_64.
* doc/posix-functions/fmal.texi: Update info.

2 years agoFix a compilation error in C++ mode on Solaris 11.4.
Bruno Haible [Sun, 4 Sep 2022 00:52:14 +0000 (02:52 +0200)]
Fix a compilation error in C++ mode on Solaris 11.4.

* lib/uchar.in.h (c32rtomb): Enable the C++ alias warning only on
glibc ≥ 2.16 systems. Fix a GNULIB_POSIXCHECK mistake.
(mbrtoc32): Enable the C++ alias warning only on glibc ≥ 2.16 systems.

2 years agoFix compilation errors of C++ tests on Solaris 10 with Sun C++.
Bruno Haible [Sat, 3 Sep 2022 23:14:18 +0000 (01:14 +0200)]
Fix compilation errors of C++ tests on Solaris 10 with Sun C++.

* modules/string-c++-tests (Makefile.am): Link test-string-c++ with
$(LIBUNISTRING).
* modules/wchar-c++-tests (Makefile.am): Link test-wchar-c++ with
$(LIBUNISTRING).

2 years agoFix a compilation error in C++ mode on FreeBSD 13.1.
Bruno Haible [Sat, 3 Sep 2022 20:40:05 +0000 (22:40 +0200)]
Fix a compilation error in C++ mode on FreeBSD 13.1.

* lib/signal.in.h: Don't include <pthread.h> on FreeBSD ≥ 8.0.
* lib/sys_select.in.h: Don't include <sys/time.h> on FreeBSD.

2 years agostdnoreturn: Document relation to C++.
Bruno Haible [Sat, 3 Sep 2022 20:12:42 +0000 (22:12 +0200)]
stdnoreturn: Document relation to C++.

* doc/posix-headers/stdnoreturn.texi: Document FreeBSD problem.

2 years agosysexits: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 19:13:35 +0000 (21:13 +0200)]
sysexits: Add C++ tests.

* tests/test-sysexits-c++.cc: New file.
* modules/sysexits-c++-tests: New file.
* modules/sysexits-tests (Depends-on): Add sysexits-c++-tests.

2 years agosys_utsname: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 19:10:07 +0000 (21:10 +0200)]
sys_utsname: Add C++ tests.

* tests/test-sys_utsname-c++.cc: New file.
* modules/sys_utsname-c++-tests: New file.
* modules/sys_utsname-tests (Depends-on): Add sys_utsname-c++-tests.

2 years agosys_uio: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 19:07:36 +0000 (21:07 +0200)]
sys_uio: Add C++ tests.

* tests/test-sys_uio-c++.cc: New file.
* modules/sys_uio-c++-tests: New file.
* modules/sys_uio-tests (Depends-on): Add sys_uio-c++-tests.

2 years agosys_times: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 19:02:30 +0000 (21:02 +0200)]
sys_times: Add C++ tests.

* tests/test-sys_times-c++.cc: New file.
* modules/sys_times-c++-tests: New file.
* modules/sys_times-tests (Depends-on): Add sys_times-c++-tests.

2 years agosys_file: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:58:32 +0000 (20:58 +0200)]
sys_file: Add C++ tests.

* tests/test-sys_file-c++.cc: New file.
* modules/sys_file-c++-tests: New file.
* modules/sys_file-tests (Depends-on): Add sys_file-c++-tests.

2 years agosys_file: Document this module.
Bruno Haible [Sat, 3 Sep 2022 18:57:14 +0000 (20:57 +0200)]
sys_file: Document this module.

* doc/glibc-headers/sys_file.texi: New file.
* doc/gnulib.texi (Glibc Header File Substitutes): Include it.

2 years agostdckdint: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:48:58 +0000 (20:48 +0200)]
stdckdint: Add C++ tests.

* tests/test-stdckdint-c++.cc: New file.
* modules/stdckdint-c++-tests: New file.
* modules/stdckdint-tests (Depends-on): Add stdckdint-c++-tests.

2 years agostdalign: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:42:51 +0000 (20:42 +0200)]
stdalign: Add C++ tests.

* tests/test-stdalign-c++.cc: New file.
* modules/stdalign-c++-tests: New file.
* modules/stdalign-tests (Depends-on): Add stdalign-c++-tests.

2 years agosched: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:39:11 +0000 (20:39 +0200)]
sched: Add C++ tests.

* tests/test-sched-c++.cc: New file.
* modules/sched-c++-tests: New file.
* modules/sched-tests (Depends-on): Add sched-c++-tests.

2 years agonetinet_in: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:33:32 +0000 (20:33 +0200)]
netinet_in: Add C++ tests.

* tests/test-netinet_in-c++.cc: New file.
* modules/netinet_in-c++-tests: New file.
* modules/netinet_in-tests (Depends-on): Add netinet_in-c++-tests.

2 years agonet_if: Add C++ tests.
Bruno Haible [Sat, 3 Sep 2022 18:21:37 +0000 (20:21 +0200)]
net_if: Add C++ tests.

* tests/test-net_if-c++.cc: New file.
* modules/net_if-c++-tests: New file.
* modules/net_if-tests (Depends-on): Add net_if-c++-tests.
* doc/posix-headers/net_if.texi: Fix documentation.

2 years agotermcap: Fix link error on AIX 7.
Bruno Haible [Sat, 3 Sep 2022 16:42:13 +0000 (18:42 +0200)]
termcap: Fix link error on AIX 7.

* m4/termcap.m4 (gl_TERMCAP_BODY): Search also for libxcurses and for
libcurses, like gl_TERMINFO_BODY does.
* m4/terminfo.m4 (gl_TERMINFO_BODY): Update platform list in comment.

2 years agogetrandom: Fix compilation error in C++ mode on FreeBSD 12.
Bruno Haible [Sat, 3 Sep 2022 00:48:38 +0000 (02:48 +0200)]
getrandom: Fix compilation error in C++ mode on FreeBSD 12.

* lib/sys_random.in.h (getrandom): Enable the C++ alias warning only on
glibc ≥ 2.25 systems.

2 years agomath C++ tests: Fix compilation error with clang on FreeBSD 13.
Bruno Haible [Fri, 2 Sep 2022 22:56:19 +0000 (00:56 +0200)]
math C++ tests: Fix compilation error with clang on FreeBSD 13.

* lib/math.in.h (isnan): For clang >= 11 on FreeBSD, declare 'isnan',
not 'rpl_isnan'.

2 years agostrerror_r-posix: Fix for Hurd.
Bruno Haible [Fri, 2 Sep 2022 21:45:21 +0000 (23:45 +0200)]
strerror_r-posix: Fix for Hurd.

* lib/strerror_r.c (strerror_r): Interpret return value of
__xpg_strerror_r correctly. Remove assumption about how strerror_r
behaves.

2 years agoptsname tests, ptsname_r tests: Fix test failures on Hurd.
Bruno Haible [Fri, 2 Sep 2022 20:47:49 +0000 (22:47 +0200)]
ptsname tests, ptsname_r tests: Fix test failures on Hurd.

* tests/test-ptsname.c (main): On Hurd, test only the BSD ptys that
actually exist on Hurd.
* tests/test-ptsname_r.c (main): Likewise.

2 years agostrtol, strtoul: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 18:34:44 +0000 (20:34 +0200)]
strtol, strtoul: Fix compilation error in C++ mode on Solaris 11.

* lib/stdlib.in.h (strtol, strtoul): Enable the C++ alias warning only
on glibc systems.

2 years agoaligned_alloc: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 18:07:03 +0000 (20:07 +0200)]
aligned_alloc: Fix compilation error in C++ mode on Solaris 11.

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

2 years agogetdomainname: Fix compilation error in C++ mode on Solaris 11.
Bruno Haible [Fri, 2 Sep 2022 17:48:09 +0000 (19:48 +0200)]
getdomainname: Fix compilation error in C++ mode on Solaris 11.

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

2 years agoautoupdate
Karl Berry [Fri, 2 Sep 2022 16:02:04 +0000 (09:02 -0700)]
autoupdate

2 years agoterminfo: Don't disturb the termcap module.
Bruno Haible [Fri, 2 Sep 2022 15:23:38 +0000 (17:23 +0200)]
terminfo: Don't disturb the termcap module.

* m4/terminfo.m4 (gl_TERMINFO_BODY): Save and restore the variables
determined by the gl_TERMCAP_BODY macro.

2 years agofnmatch: fix stdckdint typo
Paul Eggert [Tue, 30 Aug 2022 22:37:06 +0000 (17:37 -0500)]
fnmatch: fix stdckdint typo

* lib/fnmatch_loop.c (NEW_PATTERN): Fix typo in previous patch.
Problem and fix reported by Simon Josefsson in:
https://lists.gnu.org/r/bug-gnulib/2022-08/msg00104.html

2 years agoautoupdate
Karl Berry [Mon, 29 Aug 2022 16:20:25 +0000 (09:20 -0700)]
autoupdate

2 years agotempname: simplify by omitting _LIBC code
Paul Eggert [Thu, 25 Aug 2022 18:35:23 +0000 (13:35 -0500)]
tempname: simplify by omitting _LIBC code

* lib/tempname.c [_LIBC]: Simplify.
Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2022-08/msg00077.html
I plan to propose a corresponding patch to glibc.

2 years ago* m4/gnulib-common.m4: Fix comment.
Paul Eggert [Tue, 23 Aug 2022 16:41:27 +0000 (09:41 -0700)]
* m4/gnulib-common.m4: Fix comment.

2 years agotempname: don't lose entropy in seed
Paul Eggert [Mon, 22 Aug 2022 20:43:18 +0000 (15:43 -0500)]
tempname: don't lose entropy in seed

* lib/tempname.c (random_bits): Don't lose entropy in S
in the rare case where where the template has more than 10 Xs.
From a suggestion by Bruno Haible in:
https://bugs.gnu.org/57129#149

2 years agotempname: fix multithreading, ASLR leak etc.
Paul Eggert [Mon, 22 Aug 2022 19:07:27 +0000 (12:07 -0700)]
tempname: fix multithreading, ASLR leak etc.

Fix problems with tempname and multithreading, entropy loss,
and missing clock data (this last on non-GNU platforms).
See analysis by Bruno Haible in:
https://bugs.gnu.org/57129#149
While looking into this, I noticed that tempname can leak
info derived from ASLR into publicly-visible file names,
which is a no-no.  Fix that too.
* lib/tempname.c: Don't include stdalign.h.
(HAS_CLOCK_ENTROPY): Remove.
(mix_random_values): New function.
(random_bits): Use it.  Args are now new value address and
old value, and this function now returns a success indicator.
Omit old USE_GETRANDOM argument: always try getrandom now, as
there is no good reason not to now that GRND_NONBLOCK is used.
Caller changed.  Use CLOCK_REALTIME for for ersatz entropy,
as CLOCK_MONOTONIC doesn't work on some platforms.
Also, mix in ersatz entropy from tv_sec and from clock ().
(try_tempname_len): Do not mix in ASLR-based entropy, as
the result is published to the world and ASLR should be private.
Do not try to use a static var as that has issues if multithreaded.
Instead, simply generate new random bits.
Worry about bias only with high-quality random bits.
* modules/tempname (Depends-on): Do not depend on stdalign.

2 years agotempname: merge 64-bit time_t fix from glibc
Paul Eggert [Mon, 22 Aug 2022 19:22:52 +0000 (12:22 -0700)]
tempname: merge 64-bit time_t fix from glibc

This merges glibc commit 52a5fe70a2c77935afe807fb6e904e512ddd894e
"Use 64 bit time_t stat internally".
* lib/tempname.c (struct_stat64) [_LIBC]: Use struct __stat64_t64.
(__lstat64_time64) [!_LIBC]: Rename from __lstat64.
All uses changed.
(direxists): Use __stat64_time64 instead of __stat64.

2 years agoautoupdate
Karl Berry [Sun, 21 Aug 2022 19:51:21 +0000 (12:51 -0700)]
autoupdate

2 years agoautoupdate
Karl Berry [Fri, 19 Aug 2022 15:05:52 +0000 (08:05 -0700)]
autoupdate

2 years agotempname: Add more tests.
Bruno Haible [Tue, 16 Aug 2022 19:50:11 +0000 (21:50 +0200)]
tempname: Add more tests.

Based on scenario described by Eli Zaretskii in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-08/msg00043.html>.

* tests/test-tempname.c (main): Add another test.
* modules/tempname-tests (Status): Mark the test as unportable.

2 years agotempname: generate better names for MinGW Emacs
Paul Eggert [Tue, 16 Aug 2022 19:06:48 +0000 (12:06 -0700)]
tempname: generate better names for MinGW Emacs

On MinGW, GNU Emacs disables clock_gettime, which reliably breaks
some of gen_tempname’s optimistic callers.  Work around the
problem by making the generated names less predictable.  We don’t
need cryptographic randomness here, just enough unpredictability
to keep Emacs happy most of the time.
* lib/tempname.c (HAS_CLOCK_ENTROPY): New macro.
(random_bits): Use it.
(try_tempname_len): On systems lacking clock entropy, maintain
state so that gen_filename generates less-predictable names on
successive successful calls.

2 years agomaintainer-makefile: Check for incorrect DISTCHECK_CONFIGURE_FLAGS usage.
Simon Josefsson [Tue, 16 Aug 2022 15:26:56 +0000 (17:26 +0200)]
maintainer-makefile: Check for incorrect DISTCHECK_CONFIGURE_FLAGS usage.

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

2 years agotempname: Add tests.
Bruno Haible [Tue, 16 Aug 2022 13:27:50 +0000 (15:27 +0200)]
tempname: Add tests.

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

2 years agopmccabe2html: Doc fix.
Simon Josefsson [Mon, 15 Aug 2022 22:28:22 +0000 (00:28 +0200)]
pmccabe2html: Doc fix.

* build-aux/pmccabe2html: Don't use reserved _SOURCES namespace.
Use AM_V_GEN.  Use LC_ALL=C.

2 years agostdbool: Drop old BeOS support that gets in the way of ISO C 23 support.
Bruno Haible [Mon, 15 Aug 2022 21:38:12 +0000 (23:38 +0200)]
stdbool: Drop old BeOS support that gets in the way of ISO C 23 support.

* lib/stdbool.in.h: Don't include <OS.h>.

2 years agotempname: Fix a comment.
Bruno Haible [Mon, 15 Aug 2022 21:21:05 +0000 (23:21 +0200)]
tempname: Fix a comment.

* lib/tempname.c (try_tempname_len): Use of entropy makes the function
more, not less, secure.

2 years agotempname: remove incorrect comment
Paul Eggert [Mon, 15 Aug 2022 20:04:08 +0000 (13:04 -0700)]
tempname: remove incorrect comment

* lib/tempname.c, lib/tempname.h: Remove incorrect comment,
as the names are not necessarily hard to predict (Bug#57129).

2 years agobootstrap.conf: Use proper shell marker for Emacs.
Simon Josefsson [Sun, 14 Aug 2022 20:38:01 +0000 (22:38 +0200)]
bootstrap.conf: Use proper shell marker for Emacs.

* build-aux/bootstrap.conf: Add it.

2 years agostdbool: port to C23
Paul Eggert [Sun, 14 Aug 2022 03:00:02 +0000 (20:00 -0700)]
stdbool: port to C23

* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Copy from bleeding-edge
Autoconf.  Don’t define if Autoconf 2.72 or later.
* tests/test-stdbool.c (bool, false, true)
(__bool_true_false_are_defined): Do not require these to be
defined.  C23 still requires __bool_true_false_are_defined but
marks it as obsolescent, and it’s no longer worth testing.
(WORKING_BOOL): New macro, which also tests __STDC_VERSION__.
Use it in tests for working bool.
Test for bool instead of for _Bool, which C23 says is obsolescent.

2 years agognulib-tool.py: Fix some code generation details.
Bruno Haible [Sat, 13 Aug 2022 13:02:55 +0000 (15:02 +0200)]
gnulib-tool.py: Fix some code generation details.

* pygnulib/GLEmiter.py: Don't produce Windows CR-LFs on Windows.
(GLEmiter.po_Makevars): Emit a definition of top_builddir, not
top_subdir.
(GLEmiter.po_POTFILES_in): Fix result when sourcebase is 'tests' or
something like that.
(GLEmiter.initmacro_start): Add two more newlines (mistake from
2021-04-11).

2 years agognulib-tool.py: Reduce code duplication.
Bruno Haible [Sat, 13 Aug 2022 11:18:06 +0000 (13:18 +0200)]
gnulib-tool.py: Reduce code duplication.

* pygnulib/constants.py (relinverse): New function.
* pygnulib/GLEmiter.py (GLEmiter.po_Makevars,
GLEmiter.tests_Makefile_am): Use it.
* pygnulib/GLTestDir.py (GLTestDir.execute): Likewise.

2 years agohamt: fix technically undefined behavior
Marc Nieper-Wißkirchen [Fri, 12 Aug 2022 14:00:23 +0000 (16:00 +0200)]
hamt: fix technically undefined behavior

Bug reported by Bruno Haible in
<https://lists.gnu.org/r/bug-gnulib/2022-04/msg00023.html>.
* lib/hamt.c (entry_insert): Remove technically undefined
behavior when shifting an integer of N bits by N or more bits.

2 years agostdckdint: fix dependency
Paul Eggert [Wed, 10 Aug 2022 14:58:18 +0000 (07:58 -0700)]
stdckdint: fix dependency

* modules/stdckdint (Depends-on): Add stdbool.
Reported by Bruno Haible.

2 years agomaint: parenthesize macro definiens
Paul Eggert [Wed, 10 Aug 2022 07:17:58 +0000 (00:17 -0700)]
maint: parenthesize macro definiens

* lib/intprops.h (INT_ADD_OK, INT_SUBTRACT_OK, INT_MULTIPLY_OK):
* lib/pipe-filter-ii.c (GetLastError):
* lib/thread-optim.h (gl_multithreaded): Parenthesize
function-like macro definiens beginning with a unary operator;
needed for weird invocations like ‘m (...)[p]’.