]> Savannah Git Hosting - gnulib.git/log
gnulib.git
20 months agowcsstr: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:58:16 +0000 (15:58 +0200)]
wcsstr: Relicense under LGPLv2+.

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

20 months agowmemcmp: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:50:35 +0000 (15:50 +0200)]
wmemcmp: Relicense under LGPLv2+.

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

20 months agowcschr: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:46:02 +0000 (15:46 +0200)]
wcschr: Relicense under LGPLv2+.

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

20 months agoisnanl: Relicense under LGPLv2+.
Bruno Haible [Mon, 21 Aug 2023 13:08:54 +0000 (15:08 +0200)]
isnanl: Relicense under LGPLv2+.

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

20 months agoldexp: Fix compilation error in C++ mode.
Bruno Haible [Sun, 20 Aug 2023 13:01:25 +0000 (15:01 +0200)]
ldexp: Fix compilation error in C++ mode.

* lib/math.in.h (ldexp): Use _GL_CXXALIASWARN1, not _GL_CXXALIASWARN.

20 months agoldexp: Work around OpenBSD/mips64 bug.
Bruno Haible [Sun, 20 Aug 2023 00:43:01 +0000 (02:43 +0200)]
ldexp: Work around OpenBSD/mips64 bug.

* lib/math.in.h (ldexp): New declaration.
* lib/ldexp.c: New file, based on lib/ldexpl.c.
* lib/ldexpl.c: Moved the implementation to lib/ldexp.c. Just include
it.
* m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LDEXP.
(gl_MATH_H_DEFAULTS): Initialize REPLACE_LDEXP.
* m4/ldexp.m4 (gl_FUNC_LDEXP): Require gl_MATH_H_DEFAULTS and
gl_FUNC_ISNAND. Invoke gl_FUNC_LDEXP_WORKS. Set REPLACE_LDEXP. Consider
it when setting LDEXP_LIBM.
(gl_FUNC_LDEXP_WORKS): New macro.
* modules/math (Makefile.am): Substitute GNULIB_LDEXP, REPLACE_LDEXP.
* modules/ldexp (Files): Add lib/ldexp.c.
(Depends-on): Add math, isnand.
(configure.ac): Set GL_COND_OBJ_LDEXP. Invoke gl_MATH_MODULE_INDICATOR.
(Makefile.am): Conditionally compile ldexp.c.
* modules/ldexpl (Files): Add lib/ldexp.c.
* doc/posix-functions/ldexp.texi: Mention the OpenBSD bug.

20 months agoldexpl: Relicense under LGPLv2+.
Bruno Haible [Sun, 20 Aug 2023 01:10:00 +0000 (03:10 +0200)]
ldexpl: Relicense under LGPLv2+.

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

20 months agoisnand: Relicense under LGPLv2+.
Bruno Haible [Sun, 20 Aug 2023 00:19:04 +0000 (02:19 +0200)]
isnand: Relicense under LGPLv2+.

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

20 months agoldexpl: Avoid possible -Wshadow warning.
Bruno Haible [Sat, 19 Aug 2023 23:44:26 +0000 (01:44 +0200)]
ldexpl: Avoid possible -Wshadow warning.

* lib/ldexpl.c (exp): Locally rename to 'exponent'.

20 months agoldexpl: Fix signed integer overflow.
Bruno Haible [Sat, 19 Aug 2023 23:41:56 +0000 (01:41 +0200)]
ldexpl: Fix signed integer overflow.

* lib/ldexpl.c (ldexpl): Use an 'unsigned int' variable to represent the
absolute value of exp without overflow.

20 months agologbl: Work around endless loop on OpenBSD 7.3/mips64.
Bruno Haible [Sat, 19 Aug 2023 22:45:05 +0000 (00:45 +0200)]
logbl: Work around endless loop on OpenBSD 7.3/mips64.

* m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Terminate the test program if it
takes longer than 5 seconds.
* doc/posix-functions/logbl.texi: Mention the OpenBSD bug.

20 months agothrd: Work around thrd_join bug on AIX 7.3.1.
Bruno Haible [Fri, 18 Aug 2023 20:38:04 +0000 (22:38 +0200)]
thrd: Work around thrd_join bug on AIX 7.3.1.

* m4/threads_h.m4 (gl_THREADS_H): Test against AIX 7 thrd_join bug. Set
BROKEN_THRD_JOIN.
(gl_THREADS_H_DEFAULTS): Initialize BROKEN_THRD_JOIN.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Set REPLACE_THRD_* to 1 also if
BROKEN_THRD_JOIN is 1. Define BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* modules/threads-h (Makefile.am): Substitute BROKEN_THRD_JOIN.
* lib/threads.in.h (rpl_thrd_t, thrd_t): Define also if BROKEN_THRD_JOIN
is 1.
* lib/thrd.c: Test BROKEN_THRD_START_T_OR_JOIN instead of
BROKEN_THRD_START_T.
* doc/posix-functions/thrd_join.texi: Update.
* doc/posix-functions/thrd_exit.texi: Likewise.

20 months agothrd: Refactor.
Bruno Haible [Fri, 18 Aug 2023 19:14:40 +0000 (21:14 +0200)]
thrd: Refactor.

* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Define BROKEN_THRD_JOIN_NULL, not
BROKEN_THRD_JOIN. Rename gl_cv_func_thrd_join_works to
gl_cv_func_thrd_join_null_works.
* lib/thrd.c: Test BROKEN_THRD_JOIN_NULL instead of BROKEN_THRD_JOIN.

20 months agothrd: On AIX 7.1 and 7.2, override also thrd_exit.
Bruno Haible [Fri, 18 Aug 2023 18:52:08 +0000 (20:52 +0200)]
thrd: On AIX 7.1 and 7.2, override also thrd_exit.

* lib/threads.in.h (thrd_exit): Consider REPLACE_THRD_EXIT.
* lib/thrd.c (rpl_thrd_exit): New function.
* m4/threads_h.m4 (gl_THREADS_H_DEFAULTS): Initialize REPLACE_THRD_EXIT.
* m4/thrd.m4 (gl_FUNC_THRD_JOIN): Set also REPLACE_THRD_EXIT and adjust
LIBSTDTHREAD.
* modules/threads-h (Makefile.am): Substitute REPLACE_THRD_EXIT.
* doc/posix-functions/thrd_exit.texi: Mention the AIX thrd_join problem
also here.

20 months agoaligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.
Bruno Haible [Fri, 18 Aug 2023 16:54:28 +0000 (18:54 +0200)]
aligned_alloc: Fix test failure on AIX 7.3 with ibm-clang.

* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use 'volatile', to
disable optimization of ibm-clang -O2.
* doc/posix-functions/aligned_alloc.texi: Update version info.

20 months agosys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc.
Bruno Haible [Fri, 18 Aug 2023 15:25:26 +0000 (17:25 +0200)]
sys_socket: Fix compilation errors in C++ mode on AIX 7.3 with gcc.

* lib/sys_socket.in.h (accept, getpeername, getsockname, recvfrom):
Disable _GL_CXXALIASWARN invocation on non-glibc systems.

20 months agostddef: Don't unnecessarily override max_align_t on AIX 7.3 with gcc.
Bruno Haible [Fri, 18 Aug 2023 11:46:15 +0000 (13:46 +0200)]
stddef: Don't unnecessarily override max_align_t on AIX 7.3 with gcc.

* lib/stddef.in.h (max_align_t, GNULIB_defined_max_align_t): Don't
define or override if HAVE_MAX_ALIGN_T is 1.

20 months agofnmatch: Override fnmatch from glibc versions < 2.22.
Bruno Haible [Wed, 16 Aug 2023 19:47:26 +0000 (21:47 +0200)]
fnmatch: Override fnmatch from glibc versions < 2.22.

* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Force REPLACE_FNMATCH=1 in
glibc versions < 2.22.

20 months agostdint: Fix configure test result with gcc 4.7 or 4.8.
Bruno Haible [Mon, 14 Aug 2023 00:51:01 +0000 (02:51 +0200)]
stdint: Fix configure test result with gcc 4.7 or 4.8.

* m4/stdint.m4 (gl_STDINT_H): Don't assume that _Generic works with
GCC versions < 4.9 with -std=gnu11.

20 months agoFix some test module descriptions.
Bruno Haible [Mon, 14 Aug 2023 00:02:31 +0000 (02:02 +0200)]
Fix some test module descriptions.

* modules/fclose-tests (Files): Add tests/macros.h.
* modules/getcwd-tests (Files): Likewise.
* modules/lock-tests (Files): Likewise.
* modules/posix_spawn-tests (Files): Likewise.
* modules/posix_spawnp-tests (Files): Likewise.
* modules/sh-quote-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u16-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u32-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-breaks-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-next-tests (Files): Likewise.
* modules/unigbrk/u8-grapheme-prev-tests (Files): Likewise.
* modules/unigbrk/uc-grapheme-breaks-tests (Files): Likewise.

20 months agoautoupdate
Karl Berry [Wed, 2 Aug 2023 14:01:58 +0000 (07:01 -0700)]
autoupdate

20 months agoreadutmp: Fix test failure on OpenBSD.
Bruno Haible [Mon, 31 Jul 2023 20:12:51 +0000 (22:12 +0200)]
readutmp: Fix test failure on OpenBSD.

* lib/readutmp.c (desirable_utmp_entry): On OpenBSD, eliminate entirely
empty entries.

20 months agoreadutmp: Improve comments. Fix module description.
Bruno Haible [Sun, 30 Jul 2023 13:08:59 +0000 (15:08 +0200)]
readutmp: Improve comments. Fix module description.

* lib/readutmp.h (extract_trimmed_name): Add specification comment.
(read_utmp): Move specification comment from lib/readutmp.c to here.
Mention also UTMP_FILE and READ_UTMP_USER_PROCESS.
* lib/readutmp.c (extract_trimmed_name): Fix comment.
* modules/readutmp (Include): Only include the .h file if
HAVE_UTMPX_H || HAVE_UTMP_H.

20 months agoreadutmp: work around glibc utmpx bug
Paul Eggert [Sun, 30 Jul 2023 00:06:42 +0000 (17:06 -0700)]
readutmp: work around glibc utmpx bug

When compiled with _TIME_BITS=64, glibc <utmpx.h> does not work,
because the files use 32-bit time_t and the code passes this to
the user unmodified, but <utmpx.h> defines a struct with 64-bit
time_t.  Work around this compatibility bug.  Problem reported
by Jakub Wilk via Sven Joachim <https://bugs.gnu.org/64937>.
* lib/readutmp.c (copy_utmp_entry): New function.
(read_utmp): Use it.

20 months agotime-h: Obey GNULIB_POSIXCHECK, not GNULIB_PORTCHECK.
Bruno Haible [Sat, 29 Jul 2023 16:07:45 +0000 (18:07 +0200)]
time-h: Obey GNULIB_POSIXCHECK, not GNULIB_PORTCHECK.

* lib/time.in.h (timespec_get, timespec_getres, time, nanosleep, tzset,
mktime, localtime_r, gmtime_r, localtime, strptime, ctime, strftime,
timegm): Add _GL_WARN_ON_USE invocation.
(asctime, ctime): Don't assume that these functions are declared, since
POSIX obsoletes them.
* m4/time_h.m4 (gl_TIME_H): Test for the declarations of asctime, ctime,
gmtime_r, localtime, localtime_r, mktime, nanosleep, strftime, strptime,
time, timegm, timespec_get, timespec_getres, tzset.
(gl_TIME_H_DEFAULTS): Initialize REPLACE_CTIME, REPLACE_LOCALTIME_R,
REPLACE_MKTIME, REPLACE_NANOSLEEP, REPLACE_STRFTIME, REPLACE_TIMEGM,
REPLACE_TZSET with 0 instead of GNULIB_PORTCHECK.
* m4/ctime.m4 (gl_FUNC_CTIME): Don't re-initialize REPLACE_CTIME.
* m4/time_r.m4 (gl_TIME_R): Don't re-initialize REPLACE_LOCALTIME_R.
* m4/mktime.m4 (gl_FUNC_MKTIME): Don't re-initialize REPLACE_MKTIME.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Don't re-initialize
REPLACE_NANOSLEEP.
* m4/strftime-fixes.m4 (gl_FUNC_STRFTIME): Don't re-initialize
REPLACE_STRFTIME.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Don't re-initialize REPLACE_TIMEGM.
* m4/tzset.m4 (gl_FUNC_TZSET: Don't re-initialize REPLACE_TZSET.

21 months agoposixcheck: Fix dependencies.
Bruno Haible [Fri, 28 Jul 2023 13:18:34 +0000 (15:18 +0200)]
posixcheck: Fix dependencies.

* modules/posixcheck (Depends-on): Add malloc-h, pthread-h, sched,
sys_random, threads-h, uchar.

21 months agouchar: Include the necessary snippets.
Bruno Haible [Fri, 28 Jul 2023 13:15:26 +0000 (15:15 +0200)]
uchar: Include the necessary snippets.

* lib/uchar.in.h: Add insertion points for _GL_ARG_NONNULL and
_GL_WARN_ON_USE.
* modules/uchar (Depends-on): Add snippet/arg-nonnull,
snippet/warn-on-use.
(Makefile.am): In uchar.h, include the ARG_NONNULL_H and WARN_ON_USE_H
snippets.

21 months agofnmatch: Work around bugs on FreeBSD, NetBSD, Solaris, Cygwin, Android.
Bruno Haible [Sun, 23 Jul 2023 13:26:28 +0000 (15:26 +0200)]
fnmatch: Work around bugs on FreeBSD, NetBSD, Solaris, Cygwin, Android.

* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Add three more test cases to
the test program. Reorganize its return values.

21 months agoautoupdate
Karl Berry [Fri, 21 Jul 2023 14:43:18 +0000 (07:43 -0700)]
autoupdate

21 months agofts: fix compilation errors with fts_cross_check()
Pádraig Brady [Thu, 20 Jul 2023 14:08:27 +0000 (15:08 +0100)]
fts: fix compilation errors with fts_cross_check()

* lib/fts.c: Fix printf format chars.
* lib/fts_.h: Provide a declaration for users.

21 months agowcsnrtombs: Fix file list.
Bruno Haible [Wed, 19 Jul 2023 20:25:30 +0000 (22:25 +0200)]
wcsnrtombs: Fix file list.

* modules/wcsnrtombs (Files): Add locale-fr.m4.

21 months agombrlen: Fix file list.
Bruno Haible [Wed, 19 Jul 2023 20:21:47 +0000 (22:21 +0200)]
mbrlen: Fix file list.

* modules/mbrlen (Files): Add locale-fr.m4, locale-ja.m4, locale-zh.m4,
codeset.m4.

21 months agombstok_r: Simplify dependencies.
Bruno Haible [Tue, 18 Jul 2023 09:43:00 +0000 (11:43 +0200)]
mbstok_r: Simplify dependencies.

* lib/mbstok_r.c: Include <stdlib.h> instead of mbuiter.h.
* modules/mbstok_r (Depends-on): Remove mbuiter.

21 months agombsinit: Fix module description.
Bruno Haible [Sat, 15 Jul 2023 20:47:26 +0000 (22:47 +0200)]
mbsinit: Fix module description.

* modules/mbsinit (Files): Add m4/mbrtowc.m4.

21 months agoFix build errors on Linux/hppa.
Bruno Haible [Tue, 11 Jul 2023 08:08:18 +0000 (10:08 +0200)]
Fix build errors on Linux/hppa.

* modules/math (Makefile.am): Split long pipe command into several
smaller commands.
* modules/pthread-h (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.

21 months agoautoupdate
Karl Berry [Tue, 4 Jul 2023 14:19:04 +0000 (07:19 -0700)]
autoupdate

22 months agostriconveh: Fix module description.
Bruno Haible [Tue, 27 Jun 2023 11:25:33 +0000 (13:25 +0200)]
striconveh: Fix module description.

* modules/striconveh (Link): Add $(LIBUNISTRING).
* modules/striconveha (Link): New section.
* modules/xstriconveh (Link): New section.

22 months agostrerrorname_np: Add support for Solaris 11.4/sparc.
Bruno Haible [Sun, 25 Jun 2023 17:11:26 +0000 (19:11 +0200)]
strerrorname_np: Add support for Solaris 11.4/sparc.

* lib/strerrorname_np.c (strerrorname_np): Consider ECKSUM, EFRAGS.
Allow ENOANO to be overloaded to another value.
* tests/test-strerrorname_np.c (main): Likewise.

22 months agosigdescr_np tests: Avoid test failure on glibc/sparc.
Bruno Haible [Sun, 25 Jun 2023 16:40:19 +0000 (18:40 +0200)]
sigdescr_np tests: Avoid test failure on glibc/sparc.

* tests/test-sigdescr_np.c (main): Accept the glibc result for SIGEMT.
* doc/glibc-functions/sigdescr_np.texi: Mention two glibc deficiencies.

22 months agostrerrorname_np: Work around glibc bug on PowerPC, SPARC systems.
Bruno Haible [Sun, 25 Jun 2023 16:19:06 +0000 (18:19 +0200)]
strerrorname_np: Work around glibc bug on PowerPC, SPARC systems.

* m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also
strerrorname_np (EDEADLOCK).
* doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36
still needs a workaround.

22 months agoautoupdate
Karl Berry [Sat, 24 Jun 2023 16:24:50 +0000 (09:24 -0700)]
autoupdate

22 months agolargefile: port to GNU/Linux alpha and s390x
Paul Eggert [Mon, 19 Jun 2023 21:08:06 +0000 (14:08 -0700)]
largefile: port to GNU/Linux alpha and s390x

This patch syncs from Autoconf master.
Problem reported by Matoro <https://bugs.gnu.org/64123>.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_CODE):
New overridable macro FTYPE, to test types other than off_t.
(_AC_SYS_LARGEFILE_TEST_CODE): Test ino_t for
-D_FILE_OFFSETBITS=64 too, if no flags are needed for off_t.
Needed for GNU/Linux on alpha and s390x.

22 months agoaligned-malloc, rmdir-errno: Sanitize configuration test result.
Bruno Haible [Thu, 15 Jun 2023 06:38:48 +0000 (08:38 +0200)]
aligned-malloc, rmdir-errno: Sanitize configuration test result.

* m4/malloc-align.m4 (gl_MALLOC_ALIGNMENT): Don't put a newline at the
end of the conftest.out file.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Don't put a newline at the
end of the confdir2/errno file.

22 months agomaint.mk: sc_prohibit_xalloc_without_use: also match alloc_die
Jim Meyering [Fri, 9 Jun 2023 17:15:30 +0000 (10:15 -0700)]
maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die

* top/maint.mk (sc_prohibit_xalloc_without_use):
Adjust in-comment command's regexp so it also finds alloc_die,
whose declaration has a prefix of "_Noreturn" .
Also delete some now-obsolete commentary.
(_xa1): Regenerate the regexp using that command.
Reported by Pádraig Brady in
<https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html>.

22 months agoxalloc-die: omit /*extern*/
Paul Eggert [Fri, 9 Jun 2023 18:13:19 +0000 (11:13 -0700)]
xalloc-die: omit /*extern*/

* lib/xalloc.h (xalloc_die): Omit leading "/*extern*/".
It complicates syntax checking; see:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html
Plus, it’s inconsistent style: the other function declarations in
xalloc.h don’t use ‘extern’. (I’m not a fan of using ‘extern’ when
it’s just noise, as is the case here.)

22 months agomaint.mk: regenerate regex to reflect new functions in xalloc.h
Jim Meyering [Wed, 7 Jun 2023 03:49:22 +0000 (20:49 -0700)]
maint.mk: regenerate regex to reflect new functions in xalloc.h

* top/maint.mk (sc_prohibit_xalloc_without_use) [_xa1]:
Regenerate using the command listed in the comment.

22 months agoPut "/" at end of .gitignore directory names
Paul Eggert [Tue, 6 Jun 2023 21:23:39 +0000 (14:23 -0700)]
Put "/" at end of .gitignore directory names

* build-aux/bootstrap: Regenerate.
* top/bootstrap-funclib.sh (symlink_to_dir, autogen):
Put slashes after .gitignore entries that name directories.

22 months agoposix_spawn-internal: Fix a warning (regression 2022-11-20).
Bruno Haible [Mon, 5 Jun 2023 13:45:25 +0000 (15:45 +0200)]
posix_spawn-internal: Fix a warning (regression 2022-11-20).

* lib/spawni.c: Don't use this particular #pragma for gcc < 4.2.

23 months agostriconveha: Don't crash if malloc() returns NULL.
Bruno Haible [Fri, 2 Jun 2023 18:11:41 +0000 (20:11 +0200)]
striconveha: Don't crash if malloc() returns NULL.

* lib/striconveha.c (mem_iconveha, str_iconveha): Check malloca() return
value.

23 months agosetenv: Don't crash if malloc() returns NULL.
Bruno Haible [Fri, 2 Jun 2023 18:11:36 +0000 (20:11 +0200)]
setenv: Don't crash if malloc() returns NULL.

* lib/setenv.c (rpl_setenv): Check malloca() return value.

23 months agogetprogname: Add support for ASCII-compatible environments in z/OS.
Bruno Haible [Thu, 1 Jun 2023 14:18:02 +0000 (16:18 +0200)]
getprogname: Add support for ASCII-compatible environments in z/OS.

Reported by Mike Fulton <mikefultonpersonal@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-05/msg00198.html>.

* lib/getprogname.c (getprogname): On z/OS, when compiling for an
ASCII-compatible environment, convert the result from EBCDIC to ASCII.

23 months agoreadline: fix memory leak in replacement readline.
Nick Bowler [Wed, 31 May 2023 01:26:19 +0000 (21:26 -0400)]
readline: fix memory leak in replacement readline.

* lib/readline.c (readline): Free memory after getline failure.
Copyright-paperwork-exempt: true

23 months agoasyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.
Bruno Haible [Wed, 24 May 2023 08:17:30 +0000 (10:17 +0200)]
asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.

Reported by Brandon Applegate in
<https://lists.gnu.org/archive/html/bug-gettext/2023-05/msg00042.html>.

* lib/asyncsafe-spin.c: Limit the SPARC workaround to Solaris.
* lib/simple-atomic.c: Likewise.
* m4/sparcv8+.m4 (gl_SPARC_V8PLUS): Likewise.

23 months agossize_t: Fix replacement on 64-bit Windows.
Bruno Haible [Sun, 21 May 2023 12:40:04 +0000 (14:40 +0200)]
ssize_t: Fix replacement on 64-bit Windows.

* m4/ssize_t.m4 (gt_TYPE_SSIZE_T): Use prefix 'gl_' instead of 'gt_'.
Define ssize_t to 'long long' or 'long', depending on the width of
'size_t'.

23 months agoastrxfrm: Fix use-after-free bug.
Bruno Haible [Thu, 18 May 2023 16:01:06 +0000 (18:01 +0200)]
astrxfrm: Fix use-after-free bug.

* lib/astrxfrm.c (astrxfrm): Don't use memcpy after realloc succeeded.

23 months agognulib-tool: Ignore .orig and .rej files under modules/.
Bruno Haible [Thu, 18 May 2023 14:03:00 +0000 (16:03 +0200)]
gnulib-tool: Ignore .orig and .rej files under modules/.

* gnulib-tool (func_sanitize_modulelist): Exclude also files whose name
ends in .orig or .rej.
* pygnulib/GLModuleSystem.py (GLModuleSystem.file_is_module): Likewise.

23 months agouchar: Fix error when <uchar.h> is included twice.
Bruno Haible [Thu, 18 May 2023 13:39:19 +0000 (15:39 +0200)]
uchar: Fix error when <uchar.h> is included twice.

* lib/uchar.in.h: Fix double-inclusion guard.

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 agovasnprintf: Make '0' flag handling more ISO C compliant.
Bruno Haible [Fri, 5 May 2023 10:39:25 +0000 (12:39 +0200)]
vasnprintf: 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.

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

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 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 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 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 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 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 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 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/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 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++ mode on mingw 10.
Bruno Haible [Thu, 20 Apr 2023 00:03:43 +0000 (02:03 +0200)]
random: Fix compilation errors in C++ mode on mingw 10.

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

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 tests: Avoid test failure on Cygwin 3.4.6.
Bruno Haible [Tue, 18 Apr 2023 07:51:21 +0000 (09:51 +0200)]
c32isgraph tests: Avoid test failure on Cygwin 3.4.6.

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

2 years agoposix_spawn_file_actions_addclose tests: Avoid test failure on Cygwin.
Bruno Haible [Sun, 16 Apr 2023 11:41:17 +0000 (13:41 +0200)]
posix_spawn_file_actions_addclose tests: Avoid test failure on Cygwin.

* tests/test-posix_spawn_file_actions_addclose.c (main): Skip an
unportable test also on Cygwin.

2 years agoFix compilation errors of list, set, oset, map, omap in C++ mode.
Bruno Haible [Sat, 15 Apr 2023 16:05:57 +0000 (18:05 +0200)]
Fix compilation errors of list, set, oset, map, omap in C++ mode.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_BRACKET_BEFORE_ATTRIBUTE. In _GL_ATTRIBUTE_DEPRECATED,
_GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD, don't use the
bracket syntax if _GL_BRACKET_BEFORE_ATTRIBUTE is defined.

2 years agoisnan: Fix compilation error in C++ mode on FreeBSD 13.2.
Bruno Haible [Fri, 14 Apr 2023 22:46:57 +0000 (00:46 +0200)]
isnan: Fix compilation error in C++ mode on FreeBSD 13.2.

* lib/math.in.h (isnan): On FreeBSD 13.2 or newer, don't declare isnan
through _GL_MATH_CXX_REAL_FLOATING_DECL_2.

2 years agoialloc, gethrxtime: Restore GCC diagnostics options.
Bruno Haible [Thu, 13 Apr 2023 12:26:50 +0000 (14:26 +0200)]
ialloc, gethrxtime: Restore GCC diagnostics options.

* lib/ialloc.h: Invoke _GL_INLINE_HEADER_END.
* lib/xtime.h: Likewise.

2 years agoflexmember: Fix module description (regression 2016-09-07).
Bruno Haible [Thu, 13 Apr 2023 12:06:12 +0000 (14:06 +0200)]
flexmember: Fix module description (regression 2016-09-07).

* modules/flexmember (Include): Add "flexmember.h".

2 years agoMakefile: Fix a syntax alert.
Bruno Haible [Tue, 11 Apr 2023 17:34:50 +0000 (19:34 +0200)]
Makefile: Fix a syntax alert.

* Makefile: Indent commands with tabs, not spaces.

2 years agoyear2038: configure earlier
Paul Eggert [Mon, 10 Apr 2023 01:16:13 +0000 (18:16 -0700)]
year2038: configure earlier

* modules/year2038: Put AC_SYS_YEAR2038 in configure.ac-early
since it can affect later compilations with _TIME_BITS=64.

2 years agoc32is*: Ensure GNULIB_defined_mbstate_t is defined on AIX.
Bruno Haible [Sun, 9 Apr 2023 16:14:46 +0000 (18:14 +0200)]
c32is*: Ensure GNULIB_defined_mbstate_t is defined on AIX.

* m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Define through AC_DEFUN_ONCE.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Require it.
* modules/c32isalnum (Files): Add m4/mbrtowc.m4, m4/locale-ja.m4.
(configure.ac): Require gl_MBSTATE_T_BROKEN.
* modules/c32isalpha: Likewise.
* modules/c32isblank: Likewise.
* modules/c32iscntrl: Likewise.
* modules/c32isdigit: Likewise.
* modules/c32isgraph: Likewise.
* modules/c32islower: Likewise.
* modules/c32isprint: Likewise.
* modules/c32ispunct: Likewise.
* modules/c32isspace: Likewise.
* modules/c32isupper: Likewise.
* modules/c32isxdigit: Likewise.

2 years agombrtoc32: Add comments.
Bruno Haible [Sun, 9 Apr 2023 16:02:51 +0000 (18:02 +0200)]
mbrtoc32: Add comments.

* lib/mbrtoc32.c: Add comment regarding AIX.
* m4/mbrtoc32.m4 (gl_FUNC_MBRTOC32): Add comment regarding
GNULIB_defined_mbstate_t.

2 years agoAvoid Autoconf "was expanded before it was required" warning.
Bruno Haible [Sat, 8 Apr 2023 13:26:13 +0000 (15:26 +0200)]
Avoid Autoconf "was expanded before it was required" warning.

* m4/exponentf.m4 (gl_FLOAT_EXPONENT_LOCATION): Define through
AC_DEFUN_ONCE.
* m4/exponentd.m4 (gl_DOUBLE_EXPONENT_LOCATION): Likewise.
* m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Likewise.

2 years agostriconveh tests: Avoid test failure on glibc 2.15.
Bruno Haible [Sat, 8 Apr 2023 12:45:16 +0000 (14:45 +0200)]
striconveh tests: Avoid test failure on glibc 2.15.

* tests/test-striconveh.c (main): Skip some of the GB18030 tests on
glibc < 2.16.

2 years agounistdio/*: Fix test failures (regression 2023-01-28).
Bruno Haible [Fri, 21 Apr 2023 01:14:44 +0000 (03:14 +0200)]
unistdio/*: Fix test failures (regression 2023-01-28).

* modules/unistdio/*printf (configure.ac): Bump required libunistring
version number.