]> Savannah Git Hosting - gnulib.git/log
gnulib.git
23 months agostdio: use _GL_ATTRIBUTE_MALLOC
Paul Eggert [Sun, 14 May 2023 04:47:10 +0000 (21:47 -0700)]
stdio: use _GL_ATTRIBUTE_MALLOC

* lib/stdio.in.h (fdopen, fopen, popen, tmpfile): Declare with
_GL_ATTRIBUTE_MALLOC, for consistency with glibc, and so that
building the fopen module with ‘gcc -O2 -Wsuggest-attribute=malloc
-Wsystem-headers -Werror’ does not fail with “stdio.h: In function
‘rpl_fopen’: stdio.h:970:1: error: function might be candidate for
attribute ‘malloc’ [-Werror=suggest-attribute=malloc]”, a problem
I noticed on both Fedora 38 and Ubuntu 23.04.

sigsegv: Add tentative support for Hurd/x86_64.  Reported by
Samuel Thibault <samuel.thibault@ens-lyon.org>.

23 months agosigsegv: Add tentative support for Hurd/x86_64.
Bruno Haible [Fri, 12 May 2023 19:28:47 +0000 (21:28 +0200)]
sigsegv: Add tentative support for Hurd/x86_64.

Reported by Samuel Thibault <samuel.thibault@ens-lyon.org>.

* lib/sigsegv.c: Update from libsigsegv/src/fault-hurd-i386.h.

23 months agofile-has-acl: don’t access freed storage
Paul Eggert [Fri, 12 May 2023 19:23:49 +0000 (12:23 -0700)]
file-has-acl: don’t access freed storage

Fix typo in previous patch, by not accessing freed storage
in the unusual case where the statck buffer is not large enough.

23 months agofile-has-acl: port to Fedora 39
Paul Eggert [Fri, 12 May 2023 18:56:17 +0000 (11:56 -0700)]
file-has-acl: port to Fedora 39

Fedora 39 getxattr with XATTR_NAME_POSIX_ACL_ACCESS either
succeeds or fails with ENODATA, so it is no longer possible to
detect from its failure that the filesystem might support NFSv4 ACLs.
Problem reported by Ondrej Valousek in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00228.html
Instead, use listxattr to determine whether NFSv4 ACLs are in play.
This typically saves syscalls anyway.
* lib/file-has-acl.c: In #if, use (HAVE_LINUX_XATTR_H &&
HAVE_LISTXATTR) instead of GETXATTR_WITH_POSIX_ACLS.
The following changes apply when (USE_ACL && HAVE_LINUX_XATTR_H &&
HAVE_LISTXATTR):
Include minmax.h.
(have_xattr): New function.
(file_has_acl): Try listxattr first; typically this means we need
to do no other syscall.  Call getxattr only if there are NFSv4
ACLs but not POSIX ACLs.
* m4/acl.m4 (gl_FILE_HAS_ACL): Simplify by merely testing for
linux/xattr.h and listxattr.  All uses changed.

23 months agobootstrap: spelling/grammar fix in comment
Josh Soref [Wed, 10 May 2023 20:17:45 +0000 (13:17 -0700)]
bootstrap: spelling/grammar fix in comment

* build-aux/bootstrap: As above.

23 months agoWarn against bogus TZ settings
Paul Eggert [Sun, 7 May 2023 16:28:57 +0000 (09:28 -0700)]
Warn against bogus TZ settings

* doc/parse-datetime.texi (Specifying time zone rules):
Warn against TZ="UTC=5".

2 years agodirfd: Add tests.
Bruno Haible [Fri, 5 May 2023 10:07:22 +0000 (12:07 +0200)]
dirfd: Add tests.

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

2 years agodirfd: Fix bogus override (regression 2023-04-26).
Bruno Haible [Fri, 5 May 2023 10:02:49 +0000 (12:02 +0200)]
dirfd: Fix bogus override (regression 2023-04-26).

Reported by Bjarni Ingi Gislason <bjarniig@simnet.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00040.html>.

* m4/dirfd.m4 (gl_FUNC_DIRFD): Fix mistake in last change.

2 years agoc32swidth: Add tests.
Bruno Haible [Thu, 4 May 2023 21:27:16 +0000 (23:27 +0200)]
c32swidth: Add tests.

* tests/test-c32swidth.c: New file, based on tests/test-c32width.c.
* modules/c32swidth-tests: New file.

2 years agoc32swidth: New module.
Bruno Haible [Thu, 4 May 2023 21:27:12 +0000 (23:27 +0200)]
c32swidth: New module.

* lib/uchar.in.h (c32swidth): New declaration.
* lib/wcswidth-impl.h: Use macros FUNC, UNIT, CHARACTER_WIDTH.
* lib/wcswidth.c: Define FUNC, UNIT, CHARACTER_WIDTH before including
wcswidth-impl.h.
* lib/c32swidth.c: New file.
* modules/c32swidth: New file.
* m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize
GNULIB_C32SWIDTH.
* modules/uchar (Makefile.am): Substitute GNULIB_C32SWIDTH.

2 years agowcswidth: Fix result in case of overflow.
Bruno Haible [Thu, 4 May 2023 21:22:14 +0000 (23:22 +0200)]
wcswidth: Fix result in case of overflow.

* lib/wcswidth-impl.h (wcswidth): Continue searching for a non-printing
wide character after the total width has become > INT_MAX.

2 years agowcswidth: Relax license.
Bruno Haible [Thu, 4 May 2023 21:13:27 +0000 (23:13 +0200)]
wcswidth: Relax license.

* modules/wcswidth (License): Change to LGPLv2+.
* lib/wcswidth.c: Update license notice.
* lib/wcswidth-impl.h: Likewise.

2 years agoc32width: Relax license.
Bruno Haible [Thu, 4 May 2023 21:13:22 +0000 (23:13 +0200)]
c32width: Relax license.

* modules/c32width (License): Change to LGPLv2+.
* lib/c32width.c: Update license notice.

2 years agoc32to*: Relax license.
Bruno Haible [Thu, 4 May 2023 21:13:01 +0000 (23:13 +0200)]
c32to*: Relax license.

* modules/c32tolower (License): Change to LGPLv2+.
* modules/c32toupper (License): Likewise.
* lib/c32tolower.c: Update license notice.
* lib/c32toupper.c: Likewise.
* lib/c32to-impl.h: Likewise.

2 years agounicase/tolower, unicase/toupper: Relax license.
Bruno Haible [Thu, 4 May 2023 21:12:42 +0000 (23:12 +0200)]
unicase/tolower, unicase/toupper: Relax license.

* lib/gen-uni-tables.c (output_simple_mapping): Bump copyright year. For
unicase/tolower.h and unicase/toupper.h, use the LGPLv2+.
* lib/unicase/tolower.h: Regenerated.
* lib/unicase/toupper.h: Likewise.
* lib/unicase/simple-mapping.h: Update license notice.
* lib/unicase/tolower.c: Likewise.
* lib/unicase/toupper.c: Likewise.
* modules/unicase/tolower (License): Change to LGPLv2+.
* modules/unicase/toupper (License): Likewise.

2 years agounicase/base: Relax license.
Bruno Haible [Thu, 4 May 2023 21:12:37 +0000 (23:12 +0200)]
unicase/base: Relax license.

* modules/unicase/base (License): Change to LGPLv2+.
* lib/unicase.in.h: Update license notice.

2 years agoc32is*: Relax license.
Bruno Haible [Thu, 4 May 2023 21:11:59 +0000 (23:11 +0200)]
c32is*: Relax license.

* modules/c32isalnum (License): Change to LGPLv2+.
* modules/c32isalpha (License): Likewise.
* modules/c32isblank (License): Likewise.
* modules/c32iscntrl (License): Likewise.
* modules/c32isdigit (License): Likewise.
* modules/c32isgraph (License): Likewise.
* modules/c32islower (License): Likewise.
* modules/c32isprint (License): Likewise.
* modules/c32ispunct (License): Likewise.
* modules/c32isspace (License): Likewise.
* modules/c32isupper (License): Likewise.
* modules/c32isxdigit (License): Likewise.
* lib/c32isalnum.c: Update license notice.
* lib/c32isalpha.c: Likewise.
* lib/c32isblank.c: Likewise.
* lib/c32iscntrl.c: Likewise.
* lib/c32isdigit.c: Likewise.
* lib/c32isgraph.c: Likewise.
* lib/c32islower.c: Likewise.
* lib/c32isprint.c: Likewise.
* lib/c32ispunct.c: Likewise.
* lib/c32isspace.c: Likewise.
* lib/c32isupper.c: Likewise.
* lib/c32isxdigit.c: Likewise.
* lib/c32is-impl.h: Likewise.

2 years agounictype/ctype-*: Relax license.
Bruno Haible [Thu, 4 May 2023 21:11:54 +0000 (23:11 +0200)]
unictype/ctype-*: Relax license.

* lib/gen-uni-tables.c (output_predicate): Bump copyright year. For
unictype/ctype_*, use the LGPLv2+.
* lib/unictype/ctype_*.h: Regenerated.
* lib/unictype/ctype_*.c: Update license notice.
* modules/unictype/ctype-alnum (License): Change to LGPLv2+.
* modules/unictype/ctype-alpha (License): Likewise.
* modules/unictype/ctype-blank (License): Likewise.
* modules/unictype/ctype-cntrl (License): Likewise.
* modules/unictype/ctype-digit (License): Likewise.
* modules/unictype/ctype-graph (License): Likewise.
* modules/unictype/ctype-lower (License): Likewise.
* modules/unictype/ctype-print (License): Likewise.
* modules/unictype/ctype-punct (License): Likewise.
* modules/unictype/ctype-space (License): Likewise.
* modules/unictype/ctype-upper (License): Likewise.
* modules/unictype/ctype-xdigit (License): Likewise.

2 years agoc32width: Add tests.
Bruno Haible [Thu, 4 May 2023 11:53:41 +0000 (13:53 +0200)]
c32width: Add tests.

* tests/test-c32width.c: New file, based on tests/test-wcwidth.c.
* modules/c32width-tests: New file.

2 years agoc32width: New module.
Bruno Haible [Thu, 4 May 2023 11:52:42 +0000 (13:52 +0200)]
c32width: New module.

* lib/uchar.in.h (c32width): New declaration.
* lib/c32width.c: New file, based on lib/c32is-impl.h.
* modules/c32width: New file.
* m4/uchar_h.m4 (gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize
GNULIB_C32WIDTH.
* modules/uchar (Makefile.am): Substitute GNULIB_C32WIDTH.

2 years agodoc: Mention macOS wcwidth bug.
Bruno Haible [Thu, 4 May 2023 11:29:49 +0000 (13:29 +0200)]
doc: Mention macOS wcwidth bug.

* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Mention macOS bugs.
* doc/posix-functions/wcwidth.texi: Update regarding macOS.

2 years agovasnprintf, vasnwprintf: Make '0' flag handling more ISO C compliant.
Bruno Haible [Wed, 3 May 2023 15:09:20 +0000 (17:09 +0200)]
vasnprintf, vasnwprintf: Make '0' flag handling more ISO C compliant.

* lib/vasnprintf.c (VASNPRINTF): When doing the padding ourselves,
ignore the '0' flag if a precision is specified and the conversion is
one of d, i, o, u, x, X, b, B.
* tests/test-vasnprintf-posix.c (test_function): Update expected results
accordingly.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.

2 years agomktime: include <intprops.h>
Paul Eggert [Tue, 2 May 2023 20:18:52 +0000 (13:18 -0700)]
mktime: include <intprops.h>

* lib/mktime.c: Include <intprops.h> again,
fixing a typo noted by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-05/msg00014.html

2 years agofopen: Silence a gcc warning.
Bruno Haible [Tue, 2 May 2023 18:50:05 +0000 (20:50 +0200)]
fopen: Silence a gcc warning.

* lib/fopen.c (rpl_fopen): Mark open_direction as used.

2 years agoextern-inline: port to pcc
Paul Eggert [Mon, 1 May 2023 18:19:05 +0000 (11:19 -0700)]
extern-inline: port to pcc

* m4/extern-inline.m4 (gl_EXTERN_INLINE): Port to pcc
1.2.0.DEVEL 20220331, which doesn’t support extern inline
even though it claims to be GCC 4.3 and to support C11.

2 years agoregex: prefer C23 style overflow checking
Paul Eggert [Mon, 1 May 2023 16:10:17 +0000 (09:10 -0700)]
regex: prefer C23 style overflow checking

* lib/regex_internal.h: Include stdckdint.h.
* lib/regexec.c (re_search_2_stub):
* modules/regex (Depends-on): Add stdckdint.
Prefer stdckdint.h to intprops.h macros.

2 years agodynarray: prefer C23 style overflow checking
Paul Eggert [Mon, 1 May 2023 16:06:57 +0000 (09:06 -0700)]
dynarray: prefer C23 style overflow checking

* lib/malloc/dynarray_emplace_enlarge.c, lib/malloc/dynarray_resize.c:
Include stdckdint.h, not intprops.h.
* lib/malloc/dynarray_emplace_enlarge.c:
(__libc_dynarray_emplace_enlarge):
* lib/malloc/dynarray_resize.c (__libc_dynarray_resize):
Prefer stdckdint.h to intprops.h macros.
* modules/glibc-internal/dynarray (Depends-on):
Depend on stdckdint, not intprops.

2 years agomktime: prefer C23 style overflow checking
Paul Eggert [Mon, 1 May 2023 16:04:15 +0000 (09:04 -0700)]
mktime: prefer C23 style overflow checking

Prefer stdckdint.h macros to intprops.h macros where either will do,
as this is the C23 standard.  Also, it ports around a pcc bug.
* config/srclist.txt: Comment out mktime.c.
* lib/mktime.c: Include stdckdint.h, not intprops.h.
(__mktime_internal): Prefer stdckdint.h to intprops.h macros.
* modules/mktime (Depends-on): Add stdckdint.

2 years agolimits-h: port to pcc
Paul Eggert [Mon, 1 May 2023 15:11:12 +0000 (08:11 -0700)]
limits-h: port to pcc

* doc/posix-headers/limits.texi: Document the issue.
* lib/limits.in.h (MB_LEN_MAX): New macro, if not already defined.
* m4/limits-h.m4 (gl_LIMITS_H): Test for MB_LEN_MAX.
* tests/test-limits-h.c: Check that it’s positive.

2 years agoyear2038-recommended: new module
Paul Eggert [Sat, 29 Apr 2023 18:44:13 +0000 (11:44 -0700)]
year2038-recommended: new module

Remove year2038-required and largefile-required, replacing
the former with year2038-recommended and simply removing
the latter.  This syncs with Autoconf master.
* MODULES.html.sh, NEWS, doc/largefile.texi:
* all-modules (exclude): Exclude year2038-recommended, not -required.
* doc/posix-headers/sys_types.texi, doc/posix-headers/time.texi:
* doc/year2038.texi: Mention this.
* m4/largefile.m4: Sync from Autoconf.  Override existing macros
if AC_SYS_YEAR2038_RECOMMENDED is not defined, rather than if
AC_SYS_LARGEFILE_REQUIRED is not defined.
* modules/largefile-required, modules/year2038-required: Removed.
* modules/year2038: Do not depend on largefile; simply
use m4/largefile.m4, since we shouldn’t need the extra goodies
largefile supplies.
* modules/year2038-recommended: New module.

2 years agostdio: Avoid different configure results in different testdirs.
Bruno Haible [Sat, 29 Apr 2023 01:24:43 +0000 (03:24 +0200)]
stdio: Avoid different configure results in different testdirs.

* m4/stdio_h.m4 (gl_STDIO_H_EARLY): New macro, extracted from
gl_STDIO_H.
(gl_STDIO_H): Move the code that sets __USE_MINGW_ANSI_STDIO to
gl_STDIO_H_EARLY.
* modules/stdio (configure.ac-early): New section.

2 years agostdbool tests: Avoid compilation error with Sun C on Solaris 10.
Bruno Haible [Sat, 29 Apr 2023 01:18:17 +0000 (03:18 +0200)]
stdbool tests: Avoid compilation error with Sun C on Solaris 10.

* tests/test-stdbool.c (WORKING_BOOL): Set to 0 on Sun C.

2 years agohamt tests: Fix test failure with Sun C on Solaris 10/SPARC.
Bruno Haible [Sat, 29 Apr 2023 01:13:52 +0000 (03:13 +0200)]
hamt tests: Fix test failure with Sun C on Solaris 10/SPARC.

* tests/test-hamt.c (main): Finish with exit code 0.

2 years agolocaleconv: Work around a mingw bug.
Bruno Haible [Thu, 27 Apr 2023 23:12:16 +0000 (01:12 +0200)]
localeconv: Work around a mingw bug.

* m4/localeconv.m4 (gl_FUNC_LOCALECONV): Test whether fields of type
'char' are filled correctly.
(gl_PREREQ_LOCALECONV): Test whether 'struct lconv' has the int_{p,n}_*
members.
* lib/localeconv.c (FIX_CHAR_VALUE): New macro.
(localeconv): Replace negative field values with CHAR_MAX.
* doc/posix-functions/localeconv.texi: Mention the mingw bug.

2 years agostdlib: Fix error when cross-compiling (regression 2023-04-04).
Bruno Haible [Thu, 27 Apr 2023 16:26:45 +0000 (18:26 +0200)]
stdlib: Fix error when cross-compiling (regression 2023-04-04).

2 years agostdlib: Fix error when cross-compiling.
Bruno Haible [Thu, 27 Apr 2023 13:26:37 +0000 (15:26 +0200)]
stdlib: Fix error when cross-compiling.

Reported by Pierre Labastie <pierre.labastie@neuf.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-04/msg00220.html>.

* m4/stdlib_h.m4 (gl_STDLIB_H): Provide a 4th argument to AC_RUN_IFELSE.

2 years agofreopen-safer: pacify GCC 13
Paul Eggert [Thu, 27 Apr 2023 00:43:09 +0000 (17:43 -0700)]
freopen-safer: pacify GCC 13

* lib/freopen-safer.c: Ignore -Wanalyzer-fd-leak.

2 years agofdopendir: Fix fd leak and test failure on native Windows.
Bruno Haible [Wed, 26 Apr 2023 23:42:25 +0000 (01:42 +0200)]
fdopendir: Fix fd leak and test failure on native Windows.

* lib/dirent-private.h: On mingw, define 'struct gl_directory' as a
wrapper around the original DIR. On MSVC, add an 'fd_to_close' field to
'struct gl_directory'.
* lib/dirent.in.h (DIR): Define when DIR_HAS_FD_MEMBER is 0, i.e. on
both mingw and MSVC.
(GNULIB_defined_DIR): New macro.
(opendir): Avoid incompatible redeclaration.
(readdir): Consider REPLACE_READDIR.
(rewinddir): Consider REPLACE_REWINDDIR.
* m4/dirent_h.m4 (gl_DIRENT_DIR): New macro.
(gl_DIRENT_H): Invoke it.
(gl_DIRENT_H_DEFAULTS): Initialize REPLACE_READDIR, REPLACE_REWINDDIR.
* modules/dirent (Makefile.am): Substitute DIR_HAS_FD_MEMBER,
REPLACE_READDIR, REPLACE_REWINDDIR.
--
* lib/dirfd.c (dirfd): If GNULIB_defined_DIR, just use the
'fd_to_close' field.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Set HAVE_DIRFD. Don't set REPLACE_DIRFD
to 1 if HAVE_DIRFD is 0. If DIR_HAS_FD_MEMBER is 0, ensure dirfd.c gets
compiled.
* modules/dirfd (Files): Add lib/dirent-private.h.
(Depends-on, configure.ac): Simplify conditions.
--
* lib/closedir.c: Include <stdlib.h> always, for free().
(closedir): If GNULIB_defined_DIR, arrange to call close(dirfd(dirp)) at
the end. On mingw, call free() of dirp. Prefer testing HAVE_DIRENT_H,
for consistency with dirent.h.
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Don't set REPLACE_CLOSEDIR to 1 if
HAVE_CLOSEDIR is 0. If DIR_HAS_FD_MEMBER is 0, ensure closedir.c gets
compiled.
--
* lib/opendir.c: Include <stdlib.h> always. Include <string.h>.
(opendir): On mingw, allocate the 'struct gl_directory' through malloc.
If GNULIB_defined_DIR, set the 'fd_to_close' field to -1. Prefer
testing HAVE_DIRENT_H, for consistency with dirent.h.
* m4/opendir.m4 (gl_FUNC_OPENDIR): Don't set REPLACE_OPENDIR to 1 if
HAVE_OPENDIR is 0. If DIR_HAS_FD_MEMBER is 0, ensure opendir.c gets
compiled.
--
* lib/fdopendir.c (fdopendir): If GNULIB_defined_DIR, use a simple
implementation based on opendir and the fchdir module. If __KLIBC__,
don't define unused auxiliary functions.
* modules/fdopendir (Files): Add lib/dirent-private.h.
--
* lib/readdir.c (readdir): On mingw, redirect to the original readdir
function. Prefer testing HAVE_DIRENT_H, for consistency with dirent.h.
* m4/readdir.m4 (gl_FUNC_READDIR): If DIR_HAS_FD_MEMBER is 0, ensure
readdir.c gets compiled.
* modules/readdir (configure.ac): Consider REPLACE_READDIR.
--
* lib/rewinddir.c (rewinddir): On mingw, redirect to the original
rewinddir function. Prefer testing HAVE_DIRENT_H, for consistency with
dirent.h.
* m4/rewinddir.m4 (gl_FUNC_REWINDDIR): If DIR_HAS_FD_MEMBER is 0, ensure
rewinddir.c gets compiled.
* modules/rewinddir (configure.ac): Consider REPLACE_REWINDDIR.
--
* lib/fchdir.c (dir_info_t): Remove a FIXME.

2 years agofchdir tests: Fix test failure on native Windows.
Bruno Haible [Wed, 26 Apr 2023 22:48:21 +0000 (00:48 +0200)]
fchdir tests: Fix test failure on native Windows.

* modules/fchdir-tests (Depends-on): Add dup.

2 years agofclose: Make last change more maintainable.
Bruno Haible [Wed, 26 Apr 2023 04:06:03 +0000 (06:06 +0200)]
fclose: Make last change more maintainable.

* m4/fclose.m4 (gl_FUNC_FCLOSE): Define through AC_DEFUN_ONCE. Don't
modify REPLACE_FOPEN.
* modules/fclose (Depends-on): Add comment.
(configure.ac): Don't modify REPLACE_FOPEN. Don't duplicate actions of
module 'fopen'.
* m4/fopen.m4 (gl_FUNC_FOPEN_ITSELF): Renamed from gl_FUNC_FOPEN.
(gl_FUNC_FOPEN): New macro.
* modules/fopen (Files): Add m4/fclose.m4, m4/fflush.m4.
* m4/close.m4 (gl_FUNC_CLOSE): Define through AC_DEFUN_ONCE.

2 years agognulib-tool: For conditional dependencies, generate portable sh code.
Po Lu [Wed, 26 Apr 2023 02:57:31 +0000 (04:57 +0200)]
gnulib-tool: For conditional dependencies, generate portable sh code.

* gnulib-tool (func_emit_autoconf_snippets): Avoid sh syntax
'if ! variable', that does not work with Solaris /bin/sh.
* pygnulib/GLEmiter.py (GLEmiter.autoconfSnippets): Likewise.

2 years agoexpm1 tests: Avoid test failure on 32-bit mingw.
Bruno Haible [Tue, 25 Apr 2023 22:16:06 +0000 (00:16 +0200)]
expm1 tests: Avoid test failure on 32-bit mingw.

* tests/test-expm1.h (test_function): Mark y as 'volatile'.

2 years agopoll tests: Avoid test failure on native Windows.
Bruno Haible [Tue, 25 Apr 2023 11:38:47 +0000 (13:38 +0200)]
poll tests: Avoid test failure on native Windows.

* tests/test-poll.c (test_pipe): Disable the POLLHUP check also on
native Windows.
* doc/posix-functions/poll.texi: Mention also native Windows w.r.t.
POLLHUP.

2 years agodfa tests: Fix compilation error (regression 2023-04-22).
Bruno Haible [Tue, 25 Apr 2023 10:55:00 +0000 (12:55 +0200)]
dfa tests: Fix compilation error (regression 2023-04-22).

* tests/test-dfa-match-aux.c: Include unistd.h.
* modules/dfa-tests (Depends-on): Add unistd.

2 years agotests: Suppress ‘#pragma GCC diagnostic’ warnings with GCC < 13.
Bruno Haible [Mon, 24 Apr 2023 22:14:01 +0000 (00:14 +0200)]
tests: Suppress ‘#pragma GCC diagnostic’ warnings with GCC < 13.

* tests/test-localename.c: Disable #pragma for GCC < 12.
* tests/test-dup2.c: Disable #pragma for GCC < 13.
* tests/test-fcntl.c: Likewise.
* tests/test-getdtablesize.c: Likewise.
* tests/test-listen.c: Likewise.
* tests/test-open.h: Likewise.
* tests/test-perror2.c: Likewise.
* tests/test-select.h: Likewise.

2 years agoselect, pselect: Fix test failure on native Windows.
Bruno Haible [Mon, 24 Apr 2023 19:28:32 +0000 (21:28 +0200)]
select, pselect: Fix test failure on native Windows.

* lib/select.c (rpl_select): Fail if nfds is out-of-range.
* lib/pselect.c (pselect): Likewise.

2 years agofclose: pacify gcc -Wanalyzer-file-leak
Paul Eggert [Mon, 24 Apr 2023 19:06:55 +0000 (12:06 -0700)]
fclose: pacify gcc -Wanalyzer-file-leak

Without this patch, building coreutils with
--enable-gcc-checking=expensive would fail with a message like
“lib/exclude.c:682:6: error: leak of FILE 'in' [CWE-775]
[-Werror=analyzer-file-leak]”, because Gnulib replaced fclose but
not fopen, and GCC saw a call to fopen followed by a call to
rpl_fclose.  The patch causes GCC to instead see a call to
rpl_fopen followed by rpl_fclose.
* m4/fclose.m4 (gl_FUNC_FCLOSE): Replace fopen when replacing
fclose.
* modules/fclose (Depends-on): Add fopen.
(configure.ac): Replace fopen when replacing fclose.

2 years agounsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var
Paul Eggert [Mon, 24 Apr 2023 19:06:54 +0000 (12:06 -0700)]
unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var

* tests/test-unsetenv.c (main): Make entry static.  Even with this
change, it’s unclear whether this test is portable POSIX code, but
that’s a different matter.

2 years agotests: suppress some unwanted -fanalyzer checking
Paul Eggert [Mon, 24 Apr 2023 19:06:54 +0000 (12:06 -0700)]
tests: suppress some unwanted -fanalyzer checking

* tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h:
* tests/test-getdtablesize.c, tests/test-listen.c:
* tests/test-localename.c, tests/test-open.h, tests/test-perror2.c:
* tests/test-select.h:
Add pragmas to disable unwanted -fanalyzer checking.

2 years agoftell, ftello: Fix recognition of pipes on native Windows.
Bruno Haible [Mon, 24 Apr 2023 17:48:47 +0000 (19:48 +0200)]
ftell, ftello: Fix recognition of pipes on native Windows.

* m4/lseek.m4 (gl_FUNC_LSEEK): Update comment.
* m4/ftello.m4 (gl_FUNC_FTELLO): On native Windows, set REPLACE_FTELLO=1
always.
* doc/posix-functions/ftello.texi: Mention the behaviour on pipes.
* doc/posix-functions/ftell.texi: Likewise.
* doc/posix-functions/fgetpos.texi: Likewise.

2 years agolseek: Fix module dependencies (regression 2021-11-15).
Bruno Haible [Mon, 24 Apr 2023 17:15:22 +0000 (19:15 +0200)]
lseek: Fix module dependencies (regression 2021-11-15).

* modules/lseek (Depends-on): Re-enable the msvc-nothrow dependency
also when WINDOWS_64_BIT_OFF_T is 0.

2 years agosystem-quote: Fix memory overrun bug on native Windows.
Bruno Haible [Mon, 24 Apr 2023 11:56:46 +0000 (13:56 +0200)]
system-quote: Fix memory overrun bug on native Windows.

* lib/system-quote.c (system_quote): Allocate enough space for the
result.

2 years agounicodeio tests: Avoid test failures on native Windows.
Bruno Haible [Mon, 24 Apr 2023 10:48:31 +0000 (12:48 +0200)]
unicodeio tests: Avoid test failures on native Windows.

* tests/test-unicodeio.c: Include localcharset.h.
(main): Handle C locales whose encoding is CP1252 or similar.
* modules/unicodeio-tests (Depends-on): Add localcharset.

2 years ago*sprintf tests: Avoid test failures on mingw 10.
Bruno Haible [Mon, 24 Apr 2023 08:57:16 +0000 (10:57 +0200)]
*sprintf tests: Avoid test failures on mingw 10.

* tests/test-vasnprintf-posix.c (test_function): On newer mingw, expect
the de-facto standard result.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* tests/test-snprintf-posix.h (test_function): Likewise.
* tests/test-sprintf-posix.h (test_function): Likewise.

2 years agoImprove quoting of AS_HELP_STRING's first argument.
Bruno Haible [Sun, 23 Apr 2023 23:57:33 +0000 (01:57 +0200)]
Improve quoting of AS_HELP_STRING's first argument.

* m4/acl.m4 (gl_FUNC_ACL_ARG): Don't underquote AS_HELP_STRING's first
argument.
* m4/assert.m4 (gl_ASSERT): Likewise.
* m4/gc.m4 (gl_GC): Likewise.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
* m4/ld-version-script.m4 (gl_LD_VERSION_SCRIPT): Likewise.
* m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise.
* m4/libgmp.m4 (gl_LIBGMP): Likewise.
* m4/regex.m4 (gl_REGEX): Likewise.
* m4/relocatable-lib.m4 (gl_RELOCATABLE_NOP): Likewise.
* m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Likewise.
* m4/sigsegv.m4 (gl_SIGSEGV): Likewise.
* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Likewise.
* m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Likewise.
* m4/version-etc.m4 (gl_VERSION_ETC_FLAG): Likewise.
* m4/xattr.m4 (gl_FUNC_XATTR): Likewise.
* doc/manywarnings.texi (manywarnings): Likewise. This avoids the use of
quadrigraphs.

2 years agocategory-none: Fix link errors on MSVC, when libunistring is installed.
Bruno Haible [Sun, 23 Apr 2023 18:19:50 +0000 (20:19 +0200)]
category-none: Fix link errors on MSVC, when libunistring is installed.

* modules/unictype/category-none (configure.ac): Remove
gl_LIBUNISTRING_MODULE invocation.
(Makefile.am): Compile unictype/categ_none.c always.

2 years agomanywarnings: use AS_IF
Paul Eggert [Sun, 23 Apr 2023 15:54:00 +0000 (08:54 -0700)]
manywarnings: use AS_IF

* m4/manywarnings.m4 (gl_MANYWARN_COMPLEMENT):
Use AS_IF when the body contains Autoconf macros that could
conceivably require something.

2 years agomanywarnings: update C warnings for GCC 13
Paul Eggert [Sun, 23 Apr 2023 15:53:59 +0000 (08:53 -0700)]
manywarnings: update C warnings for GCC 13

Adjust for C programs compiled by GCC 13.
(A C++ expert still needs to look at manywarnings-c++.m4.)
* build-aux/gcc-warning.spec: Add warnings introduced in GCC 13.
* doc/manywarnings.texi (manywarnings): Document flex arrays.
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Add
-fstrict-flex-arrays and -Wstrict-flex-arrays as these should be
suitable for Gnulib-using code.

2 years agomanywarnings: bring doc up to date
Paul Eggert [Sun, 23 Apr 2023 15:53:59 +0000 (08:53 -0700)]
manywarnings: bring doc up to date

* doc/manywarnings.texi: Bring doc up to date for GCC 12.

2 years agomanywarnings: omit -fno-common in GCC 10+
Paul Eggert [Sun, 23 Apr 2023 15:53:55 +0000 (08:53 -0700)]
manywarnings: omit -fno-common in GCC 10+

* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Omit -fno-common
in GCC 10 and later, as it is the default there.
Check exit status of ‘gcc --version’.

2 years agolibunistring: Fix build on Windows, when a libunistring is installed.
Bruno Haible [Sun, 23 Apr 2023 11:25:42 +0000 (13:25 +0200)]
libunistring: Fix build on Windows, when a libunistring is installed.

* lib/unicase.in.h: Include <unistring/woe32dll.h>.
(unicase_empty_prefix_context, unicase_empty_suffix_context): Declare
with GNULIB_UNICASE_..._DLL_VARIABLE.
* lib/unictype.in.h: Include <unistring/woe32dll.h>.
(UC_CATEGORY_*, UC_PROPERTY_*): Declare with
GNULIB_UNICTYPE_..._DLL_VARIABLE.
* lib/uninorm.in.h: Include <unistring/woe32dll.h>.
(unicode_normalization_form uninorm_nf*): Declare with
GNULIB_UNINORM_..._DLL_VARIABLE.
* m4/libunistring-base.m4 (gl_LIBUNISTRING_MODULE_WITH_VARIABLE): New
macro.
(gl_LIBUNISTRING_LIB_PREPARE): Set HAVE_UNISTRING_WOE32DLL_H.
* m4/unicase_h.m4: New file.
* m4/unictype_h.m4: New file.
* m4/uninorm_h.m4: New file.
* modules/unicase/base (Files): Add m4/unicase_h.m4.
(configure.ac): Bump version number. Invoke gl_UNICASE_H,
gl_UNICASE_H_REQUIRE_DEFAULTS.
(Makefile.am): Substitute all GNULIB_UNICASE_*_DLL_VARIABLE.
* modules/unicase/empty-*-context (configure.ac): Invoke
gl_UNICASE_H_REQUIRE_DEFAULTS. Use gl_LIBUNISTRING_MODULE_WITH_VARIABLE.
* modules/unictype/base (Files): Add m4/unictype_h.m4.
(configure.ac): Bump version number. Invoke gl_UNICTYPE_H,
gl_UNICTYPE_H_REQUIRE_DEFAULTS.
(Makefile.am): Substitute all GNULIB_UNICTYPE_*_DLL_VARIABLE.
* modules/unictype/category-* (configure.ac): Invoke
gl_UNICTYPE_H_REQUIRE_DEFAULTS. Use
gl_LIBUNISTRING_MODULE_WITH_VARIABLE.
* modules/unictype/property-* (configure.ac): Likewise.
* modules/uninorm/base (Files): Add m4/uninorm_h.m4.
(configure.ac): Bump version number. Invoke gl_UNINORM_H,
gl_UNINORM_H_REQUIRE_DEFAULTS.
(Makefile.am): Substitute all GNULIB_UNINORM_*_DLL_VARIABLE.
* modules/uninorm/nf* (configure.ac): Invoke
gl_UNINORM_H_REQUIRE_DEFAULTS. Use gl_LIBUNISTRING_MODULE_WITH_VARIABLE.

2 years agoAvoid some Autoconf "was expanded before it was required" warnings.
Bruno Haible [Sun, 23 Apr 2023 01:29:28 +0000 (03:29 +0200)]
Avoid some Autoconf "was expanded before it was required" warnings.

* m4/locale-ar.m4 (gt_LOCALE_AR): Define through AC_DEFUN_ONCE.
* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
* m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.

2 years agostring-desc tests: Avoid test failure on native Windows.
Bruno Haible [Sat, 22 Apr 2023 15:38:28 +0000 (17:38 +0200)]
string-desc tests: Avoid test failure on native Windows.

* tests/test-string-desc.c: Include <fcntl.h>, <unistd.h>.
(main): Expect a file name argument. Write to this file, instead of to
fd 3.
* tests/test-string-desc.sh: Pass a file name as argument, instead of
using '3>'.
* modules/string-desc-tests (Depends-on): Add close.

2 years agothreadlib, pthread-h, threads-h: Avoid mingw's libwinpthread by default.
Bruno Haible [Sat, 22 Apr 2023 13:10:31 +0000 (15:10 +0200)]
threadlib, pthread-h, threads-h: Avoid mingw's libwinpthread by default.

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): Set
gl_use_winpthreads_default to 'no' by default.
(gl_AVOID_WINPTHREAD): Update comments.

2 years agoposixtm tests: Avoid test failure on native Windows.
Bruno Haible [Sat, 22 Apr 2023 11:56:55 +0000 (13:56 +0200)]
posixtm tests: Avoid test failure on native Windows.

* tests/test-posixtm.c (T): On native Windows, disable test cases that
would fail.

2 years agodfa tests: Fix test failure on mingw differently.
Bruno Haible [Sat, 22 Apr 2023 11:47:15 +0000 (13:47 +0200)]
dfa tests: Fix test failure on mingw differently.

Suggested by Paul Eggert.

* tests/test-dfa-invalid-char-class.sh: Revert last change.
* tests/test-dfa-match-aux.c: Include binary-io.h.
(main): Put stdout into binary mode.
* modules/dfa-tests (Depends-on): Add binary-io.

2 years agogetumask: Make it work on native Windows.
Bruno Haible [Thu, 20 Apr 2023 21:21:42 +0000 (23:21 +0200)]
getumask: Make it work on native Windows.

* lib/getumask.c (getumask): When TMPDIR is unset, try TMP and TEMP.
* tests/test-getumask.c (ASSUME_UMASK_CONSTANT): Define to 1 on native
Windows.

2 years agoposixtm tests: Fix link error.
Bruno Haible [Thu, 20 Apr 2023 18:02:13 +0000 (20:02 +0200)]
posixtm tests: Fix link error.

* modules/posixtm-tests (Depends-on): Add stpcpy.

2 years agoreadtokens tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 17:03:27 +0000 (19:03 +0200)]
readtokens tests: Fix test failure on mingw.

* tests/test-readtokens.sh: Transform CRLF to LF in the output, before
comparing with the expected output.

2 years agoparse-duration tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 16:51:48 +0000 (18:51 +0200)]
parse-duration tests: Fix test failure on mingw.

* tests/test-parse-duration.sh: Transform CRLF to LF in the output,
before analyzing the output.

2 years agodfa tests: Fix test failure on mingw.
Bruno Haible [Thu, 20 Apr 2023 16:39:33 +0000 (18:39 +0200)]
dfa tests: Fix test failure on mingw.

* tests/test-dfa-invalid-char-class.sh: Transform CRLF to LF in the
output, before comparing with the expected output.

2 years agoFix uses of libwinpthread on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 14:40:20 +0000 (16:40 +0200)]
Fix uses of libwinpthread on mingw 10.

* m4/threadlib.m4 (gl_WEAK_SYMBOLS): On mingw, set the result to
"guessing no".

2 years agoMove remaining call_once tests from mtx-tests to call_once-tests.
Bruno Haible [Thu, 20 Apr 2023 12:21:09 +0000 (14:21 +0200)]
Move remaining call_once tests from mtx-tests to call_once-tests.

* tests/test-call_once1.c: Renamed from tests/test-call_once.c.
* tests/test-call_once2.c: New file, based on tests/test-mtx.c.
* tests/test-mtx.c: Remove the code that was testing call_once.
* modules/call_once-tests (Files): Add test-call_once1.c,
test-call_once2.c. Remove test-call_once.c.
(Depends-on): Add thrd, lock, stdint.
(configure.ac): Check for alarm.
(Makefile.am): Test test-call_once1 instead of test-call_once. Also test
test-call_once2.

2 years agoexecute tests: Fix compilation error on mingw (regression 2023-01-17).
Bruno Haible [Thu, 20 Apr 2023 11:23:52 +0000 (13:23 +0200)]
execute tests: Fix compilation error on mingw (regression 2023-01-17).

* tests/test-execute-main.c (main): Don't use SIGPIPE if it's not
defined.

2 years agoassert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.
Bruno Haible [Thu, 20 Apr 2023 06:42:56 +0000 (08:42 +0200)]
assert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.

* lib/verify.h (_Static_assert): In C++ mode with MSVC 14.1 or newer,
define merely to static_assert.
(static_assert): In C++ mode with MSVC 14.1 or newer, don't define.

2 years agochown, lchown tests: Fix link error on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:51:43 +0000 (02:51 +0200)]
chown, lchown tests: Fix link error on mingw 10.

* modules/chown-tests (configure.ac): Test whether getgid() exists.
* modules/lchown-tests (configure.ac): Likewise.
* modules/fchownat-tests (configure.ac): Likewise.
* tests/test-chown.h (getgid): Define a fallback.
* tests/test-lchown.h (getgid): Likewise.

2 years agochown tests: Fix link error on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:29:26 +0000 (02:29 +0200)]
chown tests: Fix link error on mingw 10.

* modules/chown-tests (configure.ac): Test whether getgid() exists.
* modules/fchownat-tests (configure.ac): Likewise.
* tests/test-chown.h (getgid): Define a fallback.

2 years agoctime: Fix compilation errors in C++ mode on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:18:59 +0000 (02:18 +0200)]
ctime: Fix compilation errors in C++ mode on mingw 10.

* lib/c++defs.h (_GL_FUNCDECL_RPL): Add a comment.
* lib/time.in.h (ctime): Don't use _GL_ATTRIBUTE_DEPRECATED before
_GL_FUNCDECL_RPL in C++ mode.

2 years agorandom: Fix compilation errors in C++ on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:03:43 +0000 (02:03 +0200)]
random: Fix compilation errors in C++ on mingw 10.

* lib/stdlib.in.h (random, srandom): Disable _GL_CXXALIASWARN invocation
on non-glibc systems.

2 years agoyear2038-required: Fix configure failure with MSVC.
Bruno Haible [Wed, 19 Apr 2023 21:20:54 +0000 (14:20 -0700)]
year2038-required: Fix configure failure with MSVC.

* m4/largefile.m4 (_AC_SYS_LARGEFILE_PROBE): Distinguish the results
"support not detected" and "supported through gnulib". If the result is
"supported through gnulib", don't fail.

2 years agodoc: Add references to changes accepted for future POSIX revisions.
Bruno Haible [Wed, 19 Apr 2023 18:07:52 +0000 (20:07 +0200)]
doc: Add references to changes accepted for future POSIX revisions.

* doc/glibc-functions/bind_textdomain_codeset.texi: Add reference to
www.austingroupbugs.net issue.
* doc/glibc-functions/bindtextdomain.texi: Likewise.
* doc/glibc-functions/dcgettext.texi: Likewise.
* doc/glibc-functions/dcngettext.texi: Likewise.
* doc/glibc-functions/dgettext.texi: Likewise.
* doc/glibc-functions/dngettext.texi: Likewise.
* doc/glibc-functions/getentropy.texi: Likewise.
* doc/glibc-functions/getresgid.texi: Likewise.
* doc/glibc-functions/getresuid.texi: Likewise.
* doc/glibc-functions/gettext.texi: Likewise.
* doc/glibc-functions/ngettext.texi: Likewise.
* doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi:
Likewise.
* doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
Likewise.
* doc/glibc-functions/setresgid.texi: Likewise.
* doc/glibc-functions/setresuid.texi: Likewise.
* doc/glibc-functions/textdomain.texi: Likewise.
* doc/posix-functions/asctime_r.texi: Likewise.
* doc/posix-functions/ctime_r.texi: Likewise.

2 years agowcsncmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 15:59:58 +0000 (17:59 +0200)]
wcsncmp: Add tests.

* tests/test-wcsncmp.c: New file, based on tests/unistr/test-strncmp.h
and tests/test-wcscmp.c.
* modules/wcsncmp-tests: New file.

2 years agowcsncmp: Work around two ISO C compliance bugs on several platforms.
Bruno Haible [Wed, 19 Apr 2023 15:59:03 +0000 (17:59 +0200)]
wcsncmp: Work around two ISO C compliance bugs on several platforms.

* lib/wchar.in.h (wcsncmp): Consider REPLACE_WCSNCMP.
* lib/wcsncmp-impl.h (wcsncmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wcsncmp.m4 (gl_FUNC_WCSNCMP): Test whether wcsncmp works for all
wide characters. Set REPLACE_WCSNCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WCSNCMP.
* modules/wcsncmp (Status, Notice): Un-obsolete this module.
(configure.ac): Consider REPLACE_WCSNCMP.
* doc/posix-functions/wcsncmp.texi: Mention the two bugs.

2 years agowcscmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 00:14:44 +0000 (02:14 +0200)]
wcscmp: Add tests.

* tests/test-wcscmp.c: New file, based on tests/unistr/test-strcmp.h.
* modules/wcscmp-tests: New file.

2 years agowcscmp: Work around two ISO C compliance bugs on several platforms.
Bruno Haible [Wed, 19 Apr 2023 00:14:09 +0000 (02:14 +0200)]
wcscmp: Work around two ISO C compliance bugs on several platforms.

* lib/wchar.in.h (wcscmp): Consider REPLACE_WCSCMP.
* lib/wcscmp-impl.h (wcscmp): Don't assume that the two wide characters
are in the range 0..INT_MAX.
* m4/wcscmp.m4 (gl_FUNC_WCSCMP): Test whether wcscmp works for all wide
characters. Set REPLACE_WCSCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WCSCMP.
* modules/wcscmp (Status, Notice): Un-obsolete this module.
(configure.ac): Consider REPLACE_WCSCMP.
* doc/posix-functions/wcscmp.texi: Mention the two bugs.

2 years agowmemcmp: Add tests.
Bruno Haible [Wed, 19 Apr 2023 00:10:23 +0000 (02:10 +0200)]
wmemcmp: Add tests.

* tests/test-wmemcmp.c (main): Add comment.

2 years agowmemcmp: Add tests.
Bruno Haible [Tue, 18 Apr 2023 23:10:32 +0000 (01:10 +0200)]
wmemcmp: Add tests.

* tests/test-wmemcmp.c: New file, based on tests/unistr/test-cmp.h.
* modules/wmemcmp-tests: New file.

2 years agowmemcmp: Work around ISO C compliance bug on several platforms.
Bruno Haible [Tue, 18 Apr 2023 23:01:56 +0000 (01:01 +0200)]
wmemcmp: Work around ISO C compliance bug on several platforms.

* lib/wchar.in.h (wmemcmp): Consider REPLACE_WMEMCMP.
* lib/wmemcmp-impl.h (wmemcmp): Don't assume that the two wide
characters are in the range 0..INT_MAX.
* m4/wmemcmp.m4 (gl_FUNC_WMEMCMP): Test whether wmemcmp works for all
wide characters. Set REPLACE_WMEMCMP.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMCMP.
* modules/wchar (Makefile.am): Substitute REPLACE_WMEMCMP.
* modules/wmemcmp (configure.ac): Consider REPLACE_WMEMCMP.
* doc/posix-functions/wmemcmp.texi: Mention the bug.

2 years agodoc: Update platform list for posix_spawnp.
Bruno Haible [Tue, 18 Apr 2023 22:17:15 +0000 (00:17 +0200)]
doc: Update platform list for posix_spawnp.

* doc/posix-functions/posix_spawnp.texi: Update platform list.

2 years agoGo back to dynamic largefile, year2038 tests
Paul Eggert [Tue, 18 Apr 2023 21:25:09 +0000 (14:25 -0700)]
Go back to dynamic largefile, year2038 tests

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00134.html
* modules/largefile-tests, modules/year2038-tests (Depends-on):
Remove assert-h.
* tests/test-largefile.c, tests/test-year2038.c:
Test dynamically, not via static_assert.

2 years agodoc: mention when O_* defaults to 0
Paul Eggert [Tue, 18 Apr 2023 20:59:32 +0000 (13:59 -0700)]
doc: mention when O_* defaults to 0

* doc/posix-headers/fcntl.texi: Document in more detail which O_*
macros default to 0 in Gnulib.

2 years agodoc: Mention a Cygwin 3.4.6 bug.
Bruno Haible [Tue, 18 Apr 2023 13:01:22 +0000 (15:01 +0200)]
doc: Mention a Cygwin 3.4.6 bug.

* doc/posix-functions/readlinkat.texi: Mention a readlinkat bug on
Cygwin < 3.4.7.

2 years agoilogbl: Work around a Cygwin 3.4.6 bug.
Bruno Haible [Tue, 18 Apr 2023 11:24:42 +0000 (13:24 +0200)]
ilogbl: Work around a Cygwin 3.4.6 bug.

* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Also test the value of
ilogbl(NaN).
* doc/posix-functions/ilogbl.texi: Mention the new Cygwin bug.

2 years agofile-has-acl tests: Avoid test failures on Cygwin 3.4.6.
Bruno Haible [Tue, 18 Apr 2023 10:53:22 +0000 (12:53 +0200)]
file-has-acl tests: Avoid test failures on Cygwin 3.4.6.

* tests/test-file-has-acl.sh: Fix distinction between Linux setfacl and
Cygwin setfacl.

2 years agoc32isgraph: Avoid test failure on Cygwin 3.4.6.
Bruno Haible [Tue, 18 Apr 2023 07:51:21 +0000 (09:51 +0200)]
c32isgraph: Avoid test failure on Cygwin 3.4.6.

* tests/test-c32isgraph.c (main): Skip U+00A0 test on Cygwin.

2 years agoSlightly nicer largefile, year2038 tests
Paul Eggert [Mon, 17 Apr 2023 15:44:51 +0000 (08:44 -0700)]
Slightly nicer largefile, year2038 tests

* modules/largefile-tests, modules/year2038-tests (Depends-on):
Add assert-h, intprops.
* tests/test-largefile.c, tests/test-year2038.c:
Prefer compile-time to run-time tests.
Don’t assume CHAR_BIT == 8.

2 years agoMODULES.html.sh: Ensure hyperlinked files are displayable.
Bruno Haible [Mon, 17 Apr 2023 11:41:57 +0000 (13:41 +0200)]
MODULES.html.sh: Ensure hyperlinked files are displayable.

* MODULES.html.sh (repo_url_prefix): Use cgit instead of gitweb.

2 years agoMODULES.html.sh: Avoid a HTTP redirect.
Bruno Haible [Mon, 17 Apr 2023 11:07:28 +0000 (13:07 +0200)]
MODULES.html.sh: Avoid a HTTP redirect.

* MODULES.html.sh (repo_url_prefix): Use the unabbreviated name of the
git repository server.

2 years agoyear2038: Add tests.
Bruno Haible [Sun, 16 Apr 2023 21:35:47 +0000 (23:35 +0200)]
year2038: Add tests.

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

2 years agolargefile: Add tests.
Bruno Haible [Sun, 16 Apr 2023 21:30:36 +0000 (23:30 +0200)]
largefile: Add tests.

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