]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agovasprintf-gnu: New module.
Bruno Haible [Fri, 24 Mar 2023 10:28:38 +0000 (11:28 +0100)]
vasprintf-gnu: New module.

* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_VASPRINTF_POSIX.
(gl_FUNC_VASPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vasprintf-gnu.m4: New file, based on m4/vasprintf-posix.m4.
* modules/vasprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/glibc-functions/vasprintf.texi: Mention the new module.
* doc/glibc-functions/asprintf.texi: Likewise.

2 years agosprintf-gnu: Add tests.
Bruno Haible [Fri, 24 Mar 2023 10:23:51 +0000 (11:23 +0100)]
sprintf-gnu: Add tests.

* tests/test-sprintf-gnu.c: New file, based on
tests/test-sprintf-posix.c.
* modules/sprintf-gnu-tests: New file, based on
modules/sprintf-posix-tests.

2 years agosprintf-gnu: New module.
Bruno Haible [Fri, 24 Mar 2023 10:22:20 +0000 (11:22 +0100)]
sprintf-gnu: New module.

* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_SPRINTF_POSIX.
(gl_FUNC_SPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/sprintf-gnu.m4: New file, based on m4/sprintf-posix.m4.
* modules/sprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/posix-functions/sprintf.texi: Mention the new module.

2 years agovsprintf-gnu: Add tests.
Bruno Haible [Fri, 24 Mar 2023 10:19:18 +0000 (11:19 +0100)]
vsprintf-gnu: Add tests.

* tests/test-vsprintf-gnu.c: New file, based on
tests/test-vsprintf-posix.c.
* tests/test-sprintf-gnu.h: New file, based on
tests/test-vasnprintf-gnu.c.
* modules/vsprintf-gnu-tests: New file, based on
modules/vsprintf-posix-tests.

2 years agovsprintf-gnu: New module.
Bruno Haible [Fri, 24 Mar 2023 10:17:22 +0000 (11:17 +0100)]
vsprintf-gnu: New module.

* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_VSPRINTF_POSIX.
(gl_FUNC_VSPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vsprintf-gnu.m4: New file, based on m4/vsprintf-posix.m4.
* modules/vsprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/posix-functions/vsprintf.texi: Mention the new module.

2 years agosnprintf-gnu: Add tests.
Bruno Haible [Fri, 24 Mar 2023 10:13:47 +0000 (11:13 +0100)]
snprintf-gnu: Add tests.

* tests/test-snprintf-gnu.c: New file, based on
tests/test-snprintf-posix.c.
* modules/snprintf-gnu-tests: New file, based on
modules/snprintf-posix-tests.

2 years agosnprintf-gnu: New module.
Bruno Haible [Fri, 24 Mar 2023 10:12:47 +0000 (11:12 +0100)]
snprintf-gnu: New module.

* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_SNPRINTF_POSIX.
(gl_FUNC_SNPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/snprintf-gnu.m4: New file, based on m4/snprintf-posix.m4.
* modules/snprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/posix-functions/snprintf.texi: Mention the new module.

2 years agovsnprintf-gnu: Add tests.
Bruno Haible [Fri, 24 Mar 2023 10:06:44 +0000 (11:06 +0100)]
vsnprintf-gnu: Add tests.

* tests/test-vsnprintf-gnu.c: New file, based on
tests/test-vsnprintf-posix.c.
* tests/test-snprintf-gnu.h: New file, based on
tests/test-vasnprintf-gnu.c.
* modules/vsnprintf-gnu-tests: New file, based on
modules/vsnprintf-posix-tests.

2 years agovsnprintf-gnu: New module.
Bruno Haible [Fri, 24 Mar 2023 10:05:38 +0000 (11:05 +0100)]
vsnprintf-gnu: New module.

* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_VSNPRINTF_POSIX.
(gl_FUNC_VSNPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vsnprintf-gnu.m4: New file, based on m4/vsnprintf-posix.m4.
* modules/vsnprintf-gnu: New file, based on modules/vasnprintf-gnu.
* doc/posix-functions/vsnprintf.texi: Mention the new module.

2 years agovasnprintf-gnu: Add tests.
Bruno Haible [Thu, 23 Mar 2023 12:53:44 +0000 (13:53 +0100)]
vasnprintf-gnu: Add tests.

* tests/test-vasnprintf-gnu.c: New file, based on
tests/test-vasnprintf-posix.c.
* modules/vasnprintf-gnu-tests: New file.

2 years agovasnprintf-gnu: New module.
Bruno Haible [Thu, 23 Mar 2023 12:51:41 +0000 (13:51 +0100)]
vasnprintf-gnu: New module.

Suggested by Eric Blake in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00060.html>.

* lib/printf-parse.c (PRINTF_PARSE): Recognize the 'B' conversion.
* lib/printf-parse.h: Update comments.
* lib/wprintf-parse.h: Likewise.
* lib/vasnprintf.c (MAX_ROOM_NEEDED): Treat the 'B' conversion like 'b'.
(VASNPRINTF): Implement 'B' conversion if
NEED_PRINTF_DIRECTIVE_UPPERCASE_B is set. Support the 'B' conversion if
requested.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): When cross-compiling, guess yes
on glibc >= 2.35.
(gl_PRINTF_DIRECTIVE_UPPERCASE_B): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS): Renamed
from gl_PREREQ_VASNPRINTF_WITH_EXTRAS.
(gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B,
gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS): New macros.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): New macro,
extracted from gl_FUNC_VASNPRINTF_POSIX.
(gl_FUNC_VASNPRINTF_POSIX): Require it. Invoke
gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS.
* m4/vasnprintf-gnu.m4: New file.
* modules/vasnprintf-gnu: New file.
* modules/c-vasnprintf (configure.ac): Update.
* modules/unistdio/u8-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u8-u8-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u16-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u16-u16-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u32-vasnprintf (configure.ac): Likewise.
* modules/unistdio/u32-u32-vasnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vasnprintf (configure.ac): Likewise.

2 years agoprintf-posix tests: Fix compilation error (regression 2021-08-28).
Bruno Haible [Fri, 24 Mar 2023 01:45:09 +0000 (02:45 +0100)]
printf-posix tests: Fix compilation error (regression 2021-08-28).

* modules/printf-posix-tests (Files): Add tests/qemu.h.

2 years agognu-web-doc-update: don't use host alias, cvs.sv.gnu.org
Jim Meyering [Thu, 23 Mar 2023 02:51:12 +0000 (19:51 -0700)]
gnu-web-doc-update: don't use host alias, cvs.sv.gnu.org

* build-aux/gnu-web-doc-update: Use hostname cvs.savannah.gnu.org,
not cvs.sv.gnu.org. Using the shorter alias would elicit this:
  $ pkg=grep ; cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg
  Bad server host key: Invalid key length

2 years ago*printf-posix: Fix implementation of %b directive.
Bruno Haible [Wed, 22 Mar 2023 20:43:23 +0000 (21:43 +0100)]
*printf-posix: Fix implementation of %b directive.

* lib/vasnprintf.c (VASNPRINTF): In the %b directive implementation, fix
the precision handling, and ignore the '0' flag when a width and a
precision are both present.
* tests/test-snprintf-posix.h (test_function): Add test cases for the %x
directive and more test cases for the %b directive.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* modules/vasnwprintf-posix-tests (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

2 years agovasnwprintf: Fix a warning: implicit declaration of function ‘wcsnlen’.
Bruno Haible [Wed, 22 Mar 2023 20:33:24 +0000 (21:33 +0100)]
vasnwprintf: Fix a warning: implicit declaration of function ‘wcsnlen’.

* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test also whether wcsnlen is
declared.
* lib/vasnprintf.c (local_wcsnlen): Together with HAVE_WCSNLEN, test
also HAVE_DECL_WCSNLEN.

2 years agovasnwprintf: Fix a "warning: unused function local_wcsnlen".
Bruno Haible [Wed, 22 Mar 2023 20:28:21 +0000 (21:28 +0100)]
vasnwprintf: Fix a "warning: unused function local_wcsnlen".

* lib/vasnprintf.c: Adjust #if conditions.

2 years agovasnwprintf: Fix test failures on FreeBSD, NetBSD, AIX, mingw.
Bruno Haible [Wed, 22 Mar 2023 18:39:33 +0000 (19:39 +0100)]
vasnwprintf: Fix test failures on FreeBSD, NetBSD, AIX, mingw.

* m4/printf.m4 (gl_SWPRINTF_WORKS): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it and define
HAVE_WORKING_SWPRINTF accordingly.
* lib/vasnprintf.c: Together with HAVE_SWPRINTF, test also
HAVE_WORKING_SWPRINTF.
(VASNPRINTF): If WIDE_CHAR_VERSION && !DCHAR_IS_TCHAR, don't pass a
wchar_t[] to snprintf. Add a workaround against mingw's snwprintf
function.
* doc/posix-functions/swprintf.texi: Document the null wide character
bug.

2 years agovasnwprintf: Fix a "warning: unused function 'wmax_room_needed'".
Bruno Haible [Wed, 22 Mar 2023 16:46:23 +0000 (17:46 +0100)]
vasnwprintf: Fix a "warning: unused function 'wmax_room_needed'".

* lib/vasnprintf.c (MAX_ROOM_NEEDED): Adjust #if condition.

2 years agovasnwprintf: Simplify last change.
Bruno Haible [Wed, 22 Mar 2023 14:01:53 +0000 (15:01 +0100)]
vasnwprintf: Simplify last change.

* lib/vasnprintf.c (VASNPRINTF): Remove unused variable 'len'.

2 years agovasnwprintf tests: Fix link errors on AIX.
Bruno Haible [Wed, 22 Mar 2023 13:42:58 +0000 (14:42 +0100)]
vasnwprintf tests: Fix link errors on AIX.

* modules/vasnwprintf (Link): New section.
* modules/vasnwprintf-posix (Link): New section.
* modules/vasnwprintf-tests (Makefile.am): Link test-vasnwprintf with
$(MBRTOWC_LIB).
* modules/vasnwprintf-posix-tests (Makefile.am): Link
test-vasnwprintf-posix, test-vasnwprintf-posix2, test-vasnwprintf-posix3
with $(MBRTOWC_LIB).

2 years agognu-web-doc-update: Make it work for the first upload of a manual.
Bruno Haible [Wed, 22 Mar 2023 05:43:02 +0000 (06:43 +0100)]
gnu-web-doc-update: Make it work for the first upload of a manual.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00066.html>.

* build-aux/gnu-web-doc-update: Put the 'manual' directory under version
control if it is not yet.

2 years agounistdio/u*-vasnprintf: Fix conversion of %Id directive result.
Bruno Haible [Wed, 22 Mar 2023 05:13:18 +0000 (06:13 +0100)]
unistdio/u*-vasnprintf: Fix conversion of %Id directive result.

* lib/vasnprintf.c (VASNPRINTF): Don't assume that snprintf's result is
entirely ASCII if the directive contain the glibc 'I' flag.

2 years agovasnwprintf: Fix for older platforms without swprintf.
Bruno Haible [Tue, 21 Mar 2023 16:47:04 +0000 (17:47 +0100)]
vasnwprintf: Fix for older platforms without swprintf.

* lib/vasnprintf.c (VASNPRINTF): In the %lc handling, ignore the
precision. Convert the snprintf result to a wchar_t[] not by mbsrtowcs,
but by a loop that does not stop at NUL characters.
* tests/test-vasnwprintf-posix.c (test_function): Add more tests for the
%c and %lc directives.
* modules/vasnwprintf (Depends-on): Add mbrtowc. Remove mbsrtowcs.

2 years agoautoupdate
Karl Berry [Tue, 21 Mar 2023 15:04:38 +0000 (08:04 -0700)]
autoupdate

2 years ago*printf-posix: Work around bug with %lc of 0 on many platforms.
Bruno Haible [Tue, 21 Mar 2023 14:49:06 +0000 (15:49 +0100)]
*printf-posix: Work around bug with %lc of 0 on many platforms.

* lib/vasnprintf.c (local_wctomb): Define also for
NEED_PRINTF_DIRECTIVE_LC.
(VASNPRINTF): Implement %lc handling ourselves if
NEED_PRINTF_DIRECTIVE_LC.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_LC): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_LC): New macro.
(gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require
gl_PRINTF_DIRECTIVE_LC and test its result. Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_LC.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise.
* tests/test-snprintf-posix.h (test_function): Add more tests for the
%c and %lc directives.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* doc/glibc-functions/asprintf.texi: Mention the %lc 0 bug.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* doc/glibc-functions/vasprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.

2 years agognupload: correct SFTP connection URL
Ar Rakin [Mon, 20 Mar 2023 07:21:27 +0000 (07:21 +0000)]
gnupload: correct SFTP connection URL

Approved by Sergey Poznyakoff in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00078.html>.

* build-aux/gnupload: fix gnu.org.ua SFTP connection URL:
puszcza.gnu.org.ua -> download.gnu.org.ua

2 years agomemrchr tests: Avoid GCC warning.
Bruno Haible [Mon, 20 Mar 2023 18:46:06 +0000 (19:46 +0100)]
memrchr tests: Avoid GCC warning.

* tests/test-memrchr.c: Don't use '#pragma GCC diagnostic' for GCC
versions older than 4.7.

2 years agounistdio: Simplify code.
Bruno Haible [Mon, 20 Mar 2023 11:39:30 +0000 (12:39 +0100)]
unistdio: Simplify code.

* lib/unistdio/u8-vasnprintf.c (DCHAR_T_IS_UINT8_T): Remove unused
macro.
* lib/unistdio/u8-u8-vasnprintf.c: Likewise.
* lib/unistdio/u16-vasnprintf.c (DCHAR_T_IS_UINT16_T): Remove unused
macro.
* lib/unistdio/u16-u32-vasnprintf.c: Likewise.
* lib/unistdio/u32-vasnprintf.c (DCHAR_T_IS_UINT32_T): Remove unused
macro.
* lib/unistdio/u32-u32-vasnprintf.c: Likewise.

2 years agovasnwprintf: Port to older platforms without swprintf.
Bruno Haible [Mon, 20 Mar 2023 18:18:02 +0000 (19:18 +0100)]
vasnwprintf: Port to older platforms without swprintf.

* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test for swprintf.
* lib/vasnprintf.c (TCHAR_T, DCHAR_IS_TCHAR, SNPRINTF): When
WIDE_CHAR_VERSION and swprintf does not exist, use TCHAR_T = char,
SNPRINTF = snprintf, and !DCHAR_IS_TCHAR.
(VASNPRINTF): In this case, implement %ls and %lc directly. Adjust a
couple of #if conditions. For the conversion from TCHAR_T[] to
DCHAR_T[], use mbsrtowcs.
* modules/vasnwprintf (Depends-on): Add mbsrtowcs.

2 years agowmemset: Relicense under LGPLv2+.
Bruno Haible [Mon, 20 Mar 2023 09:09:57 +0000 (10:09 +0100)]
wmemset: Relicense under LGPLv2+.

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

2 years agowmemcpy: Relicense under LGPLv2+.
Bruno Haible [Mon, 20 Mar 2023 09:09:16 +0000 (10:09 +0100)]
wmemcpy: Relicense under LGPLv2+.

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

2 years agovasnwprintf: Fix test failures on musl libc.
Bruno Haible [Mon, 20 Mar 2023 02:26:44 +0000 (03:26 +0100)]
vasnwprintf: Fix test failures on musl libc.

* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MUSL_LIBC.
* lib/vasnprintf.c (VASNPRINTF): On musl libc, when WIDE_CHAR_VERSION,
- force pad_ourselves to be 1,
- don't use %n.
Fix zero-padding when the result starts with a prefix "0x" or "0b".
* modules/vasnwprintf (Files): Add musl.m4.
* doc/posix-functions/swprintf.texi: Mention two musl libc bugs.

2 years agovasnwprintf: Fix module dependencies.
Bruno Haible [Mon, 20 Mar 2023 02:20:48 +0000 (03:20 +0100)]
vasnwprintf: Fix module dependencies.

* modules/vasnwprintf (Depends-on): Add wmemcpy, wmemset.
* modules/vasnwprintf-tests (Depends-on): Add wmemcmp.
* modules/vasnwprintf-posix-tests (Depends-on): Likewise.

2 years agovasnwprintf: Fix module dependencies.
Bruno Haible [Mon, 20 Mar 2023 02:12:43 +0000 (03:12 +0100)]
vasnwprintf: Fix module dependencies.

* modules/vasnwprintf (Depends-on): Add wmemcpy, wmemset.
* modules/vasnwprintf-tests (Depends-on): Add wmemcmp.
* modules/vasnwprintf-posix-tests (Depends-on): Likewise.

2 years agoFix typo in previous ChangeLog entry
Paul Eggert [Sun, 19 Mar 2023 23:07:57 +0000 (16:07 -0700)]
Fix typo in previous ChangeLog entry

2 years agotest-pselect, test-select: use different ports
Paul Eggert [Sun, 19 Mar 2023 23:06:34 +0000 (16:06 -0700)]
test-pselect, test-select: use different ports

I have served rare and hard-to-reproduce problems with the GNU
grep release candidate with ‘make -j5 check’ on Fedora 37 x86-64.
One possibility is that test-pselect and test-select interfere
with each other somehow when run simultaneously, as they use the
same port.  Work around this possibility by using different ports
from each other, and from test-poll (which also uses 12345).
Of course it’d be better if all these tests used system-assigned
ports, but I assume that’d take more work.
* tests/test-pselect.c, tests/test-select.c (TEST_PORT): New macro.
* tests/test-select.h (TEST_PORT): Remove.

2 years agoUpdate MODULES.html.sh.
Bruno Haible [Sun, 19 Mar 2023 17:50:18 +0000 (18:50 +0100)]
Update MODULES.html.sh.

* MODULES.html.sh: Move stack, wmempcpy, bison to different sections.
Fix a HTML layout problem.

2 years agodfa: pacify Oracle Solaris Studio 12.6
Paul Eggert [Sun, 19 Mar 2023 04:53:12 +0000 (21:53 -0700)]
dfa: pacify Oracle Solaris Studio 12.6

Without this patch, the compiler complains “statement not reached”.
* lib/dfa.c (lex): Refactor to omit unreachable statement.

2 years agoUpdate MODULES.html.sh
Paul Eggert [Sun, 19 Mar 2023 00:19:32 +0000 (17:19 -0700)]
Update MODULES.html.sh

* MODULES.html.sh: Add some recently-added modules.
This is by no means a complete update.  I needed to point
to something about ‘time’ so I added ‘time’, and then added
more modules until I ran out of, errr, time.
Assuming MODULES.html.sh is still useful,
at some point a more-complete update should be done.

2 years ago*printf-posix: ISO C 23: Add %b directive for binary output of integers.
Bruno Haible [Fri, 17 Mar 2023 22:54:50 +0000 (23:54 +0100)]
*printf-posix: ISO C 23: Add %b directive for binary output of integers.

* lib/printf-parse.h: Update more comments.

2 years ago*printf-posix: ISO C 23: Add %b directive for binary output of integers.
Bruno Haible [Fri, 17 Mar 2023 21:45:56 +0000 (22:45 +0100)]
*printf-posix: ISO C 23: Add %b directive for binary output of integers.

* lib/printf-parse.c (PRINTF_PARSE): Recognize the 'b' directive.
* lib/printf-parse.h: Update comment.
* lib/wprintf-parse.h: Likewise.
* lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Add support for the
'b' directive.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_B): New macro.
(gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it.
* m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_POSIX): Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_B.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require
gl_PRINTF_DIRECTIVE_B and test its result. Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_B.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise.
* tests/test-snprintf-posix.h (test_function): Add some tests of the %b
directive.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* doc/glibc-functions/asprintf.texi: Mention the 'b' directive.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* doc/glibc-functions/vasprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.

2 years agovasnprintf, vasnwprintf: Simplify code.
Bruno Haible [Fri, 17 Mar 2023 21:33:24 +0000 (22:33 +0100)]
vasnprintf, vasnwprintf: Simplify code.

* lib/vasnprintf.c (MAX_ROOM_NEEDED): Remove dead code: The directives
'o', 'x', 'X' always take an unsigned integer argument.

2 years agovasnwprintf: Fix test failure on OpenBSD.
Bruno Haible [Fri, 17 Mar 2023 18:16:26 +0000 (19:16 +0100)]
vasnwprintf: Fix test failure on OpenBSD.

* lib/vasnprintf.c (VASNPRINTF): Don't use the %n directive on OpenBSD.

2 years agotime: Fix test failure on AIX 7.2.
Bruno Haible [Fri, 17 Mar 2023 17:53:43 +0000 (18:53 +0100)]
time: Fix test failure on AIX 7.2.

* m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on AIX.
* doc/posix-functions/time.texi: Mention the bug on AIX.

2 years agotime: Fix test failure on native Windows.
Bruno Haible [Fri, 17 Mar 2023 12:31:11 +0000 (13:31 +0100)]
time: Fix test failure on native Windows.

* m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on native
Windows.
* modules/time (Depends-on): Add gettimeofday.
* doc/posix-functions/time.texi: Mention the bug on Windows.

2 years agovasnprintf, vasnwprintf: Include all necessary workarounds in libintl.
Bruno Haible [Fri, 17 Mar 2023 11:58:57 +0000 (12:58 +0100)]
vasnprintf, vasnwprintf: Include all necessary workarounds in libintl.

* lib/vasnprintf.c: Remove IN_LIBINTL special-casing.

2 years agovasnwprintf-posix: Add tests.
Bruno Haible [Fri, 17 Mar 2023 11:53:05 +0000 (12:53 +0100)]
vasnwprintf-posix: Add tests.

* tests/test-vasnwprintf-posix.c: New file, based on
tests/test-vasnprintf-posix.c.
* tests/test-vasnwprintf-posix2.sh: New file, based on
tests/test-vasnprintf-posix2.sh.
* tests/test-vasnwprintf-posix2.c: New file, based on
tests/test-vasnprintf-posix2.c.
* tests/test-vasnwprintf-posix3.c: New file, based on
tests/test-vasnprintf-posix3.c.
* modules/vasnwprintf-posix-tests: New file, based on
modules/vasnprintf-posix-tests.

2 years agovasnwprintf-posix: New module.
Bruno Haible [Fri, 17 Mar 2023 11:47:49 +0000 (12:47 +0100)]
vasnwprintf-posix: New module.

* m4/vasnwprintf-posix.m4: New file.
* modules/vasnwprintf-posix: New file, based on
modules/vasnprintf-posix.

2 years agovasnprintf-posix: Relicense under LGPLv2+.
Bruno Haible [Fri, 17 Mar 2023 11:42:09 +0000 (12:42 +0100)]
vasnprintf-posix: Relicense under LGPLv2+.

* modules/vasnprintf-posix (License): Change to LGPLv2+.

2 years agovasnwprintf: Add tests.
Bruno Haible [Fri, 17 Mar 2023 11:31:24 +0000 (12:31 +0100)]
vasnwprintf: Add tests.

* tests/test-vasnwprintf.c: New file, based on tests/test-vasnprintf.c.
* modules/vasnwprintf-tests: New file, based on
modules/vasnprintf-tests.

2 years agovasnwprintf: New module.
Bruno Haible [Fri, 17 Mar 2023 11:25:37 +0000 (12:25 +0100)]
vasnwprintf: New module.

* lib/vasnprintf.c: Enable more code for WIDE_CHAR_VERSION, because
snwprintf()/_snwprintf() (Windows) and swprintf() (Unix) don't return
the needed buffer size, like snprintf does.
* lib/wprintf-parse.h: New file, based on lib/printf-parse.h and
gettext/gettext-runtime/intl/wprintf-parse.h.
* lib/wprintf-parse.c: New file, based on
gettext/gettext-runtime/intl/printf.c.
* lib/vasnwprintf.h: New file, based on lib/vasnprintf.h and
gettext/gettext-runtime/intl/vasnwprintf.h.
* lib/vasnwprintf.c: New file.
* lib/asnwprintf.c: New file, based on lib/asnprintf.c.
* m4/vasnprintf.m4 (gl_FUNC_VASNWPRINTF): New macro.
(gl_PREREQ_VASNXPRINTF): New macro, extracted from gl_PREREQ_VASNPRINTF.
(gl_PREREQ_VASNPRINTF): Invoke it. Don't test for wcsnlen and mbrtowc.
(gl_PREREQ_VASNWPRINTF): New macro.
* modules/vasnwprintf: New file, based on modules/vasnprintf.

2 years agostrtol, strtoll, strtoul, strtoull: Make ISO C 23 compliant.
Bruno Haible [Thu, 16 Mar 2023 15:02:02 +0000 (16:02 +0100)]
strtol, strtoll, strtoul, strtoull: Make ISO C 23 compliant.

* lib/strtol.c (INTERNAL (strtol)): Treat 'b' and base 2 like 'x' and
base 16. Based on glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c
by Joseph Myers.
* m4/strtol.m4 (gl_FUNC_STRTOL): Test also whether parsing binary
integers works. Update cross-compilation guesses.
* m4/strtoll.m4 (gl_FUNC_STRTOLL): Likewise.
* m4/strtoul.m4 (gl_FUNC_STRTOUL): Likewise.
* m4/strtoull.m4 (gl_FUNC_STRTOULL): Likewise.
* tests/test-strtol.c (main): Add tests of parsing binary integers.
* tests/test-strtoll.c (main): Likewise.
* tests/test-strtoul.c (main): Likewise.
* tests/test-strtoull.c (main): Likewise.
* doc/posix-functions/strtol.texi: Mention the problem with parsing
binary integers.
* doc/posix-functions/strtoll.texi: Likewise.
* doc/posix-functions/strtoul.texi: Likewise.
* doc/posix-functions/strtoull.texi: Likewise.

2 years agotimegm: Document under ISO C and POSIX substitutes.
Bruno Haible [Thu, 16 Mar 2023 13:16:25 +0000 (14:16 +0100)]
timegm: Document under ISO C and POSIX substitutes.

* doc/posix-functions/timegm.texi: Renamed from doc/glibc-functions/timegm.texi.
* doc/gnulib.texi (Function Substitutes): Include timegm.texi here...
(Glibc time.h): ... not here.

2 years agostddef: Fix a compilation error on AIX 7.2 with xlclang.
Bruno Haible [Thu, 16 Mar 2023 13:04:26 +0000 (14:04 +0100)]
stddef: Fix a compilation error on AIX 7.2 with xlclang.

* lib/stddef.in.h (__CLANG_MAX_ALIGN_T_DEFINED): Define whenever we
define GNULIB_defined_max_align_t.

2 years agostddef: Define 'unreachable', for ISO C 23 compliance.
Bruno Haible [Thu, 16 Mar 2023 12:45:40 +0000 (13:45 +0100)]
stddef: Define 'unreachable', for ISO C 23 compliance.

* lib/verify.h (_GL_HAS_BUILTIN_UNREACHABLE): Don't define if already
defined.
* lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE, unreachable): New
macros.
(abort): Declare if needed for unreachable.
* m4/stddef_h.m4 (gl_STDDEF_H): Test for unreachable.
* tests/test-stddef.c (test_unreachable_optimization,
test_unreachable_noreturn): New functions, based on tests/test-verify.c.
* doc/posix-headers/stddef.texi: Mention unreachable.

2 years agomaint: improve notice of time change
Paul Eggert [Fri, 10 Mar 2023 23:45:56 +0000 (15:45 -0800)]
maint: improve notice of time change

2 years agoposixtm: work around Glibc time issue
Paul Eggert [Fri, 10 Mar 2023 23:42:51 +0000 (15:42 -0800)]
posixtm: work around Glibc time issue

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

2 years agobootstrap: correct last change
Jim Meyering [Thu, 9 Mar 2023 17:58:35 +0000 (09:58 -0800)]
bootstrap: correct last change

* top/bootstrap-funclib.sh (autogen) [AUTORECONFFLAGS]: Do always
apply the --no-recursive option.
* build-aux/bootstrap: Regenerate.
Spotted by Bruno Haible.

2 years agobootstrap: remove code that accommodated RHEL5's old autoreconf
Jim Meyering [Thu, 9 Mar 2023 16:41:07 +0000 (08:41 -0800)]
bootstrap: remove code that accommodated RHEL5's old autoreconf

* top/bootstrap-funclib.sh (autogen) [AUTORECONFFLAGS]: RHEL5 has not
been supported since 2017. It included (and this code worked around)
a version of autoreconf that was so old it did not accept the
--no-recursive option. Drop that workaround.
* build-aux/bootstrap: Regenerate.

2 years agogettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.
Bruno Haible [Wed, 8 Mar 2023 16:09:37 +0000 (17:09 +0100)]
gettimeofday, timespec_get tests: Avoid test failure on glibc/Linux.

* modules/gettimeofday-tests (Depends-on): Add 'time'.
* modules/timespec_get-tests (Depends-on): Likewise.
* tests/test-gettimeofday.c (test_consistency): Update comment.
* tests/test-timespec_get.c (main): Likewise.

2 years agotime: Add tests.
Bruno Haible [Wed, 8 Mar 2023 16:02:38 +0000 (17:02 +0100)]
time: Add tests.

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

2 years agotime: New module.
Bruno Haible [Wed, 8 Mar 2023 16:00:48 +0000 (17:00 +0100)]
time: New module.

* lib/time.in.h (time): New declaration.
* lib/time.c: New file.
* m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS): Initialize GNULIB_TIME.
(gl_TIME_H_DEFAULTS): Initialize REPLACE_TIME.
* m4/time.m4: New file.
* modules/time-h (Makefile.am): Substitute GNULIB_TIME, REPLACE_TIME.
* modules/time: New file.
* tests/test-time-h-c++.cc: Check the signature of
GNULIB_NAMESPACE::time.
* doc/posix-functions/time.texi: Mention the glibc problem and the
'time' module.

2 years agotime-h: Renamed from time.
Bruno Haible [Wed, 8 Mar 2023 09:41:00 +0000 (10:41 +0100)]
time-h: Renamed from time.

* modules/time-h: Renamed from modules/time.
* tests/test-time-h.c: Renamed from tests/test-time.c.
* modules/time-h-tests: Renamed from modules/time-tests. Update.
* tests/test-time-h-c++.cc: Renamed from tests/test-time-c++.cc.
* tests/test-time-h-c++2.cc: Renamed from tests/test-time-c++2.cc.
* modules/time-h-c++-tests: Renamed from modules/time-c++-tests. Update.
* modules/cond (Depends-on): Update.
* modules/ctime (Depends-on): Likewise.
* modules/localtime (Depends-on): Likewise.
* modules/mktime (Depends-on): Likewise.
* modules/nanosleep (Depends-on): Likewise.
* modules/parse-datetime (Depends-on): Likewise.
* modules/posixcheck (Depends-on): Likewise.
* modules/pthread-h (Depends-on): Likewise.
* modules/stat-time (Depends-on): Likewise.
* modules/stat-time-tests (Depends-on): Likewise.
* modules/strftime-fixes (Depends-on): Likewise.
* modules/strptime (Depends-on): Likewise.
* modules/sys_stat (Depends-on): Likewise.
* modules/tempname (Depends-on): Likewise.
* modules/threads-h (Depends-on): Likewise.
* modules/time_r (Depends-on): Likewise.
* modules/time_rz (Depends-on): Likewise.
* modules/timegm (Depends-on): Likewise.
* modules/timespec (Depends-on): Likewise.
* modules/timespec_get (Depends-on): Likewise.
* modules/timespec_getres (Depends-on): Likewise.
* modules/tzset (Depends-on): Likewise.
* modules/usleep-tests (Depends-on): Likewise.
* modules/utime (Depends-on): Likewise.
* modules/utimecmp (Depends-on): Likewise.
* modules/utimens (Depends-on): Likewise.
* modules/windows-cond (Depends-on): Likewise.
* modules/windows-timedmutex (Depends-on): Likewise.
* modules/windows-timedrecmutex (Depends-on): Likewise.
* modules/windows-timedrwlock (Depends-on): Likewise.
* modules/xnanosleep (Depends-on): Likewise.
* doc/posix-headers/time.texi: Update.
* NEWS: Mention the change.

2 years agogettimeofday tests: Enhance test.
Bruno Haible [Wed, 8 Mar 2023 09:14:00 +0000 (10:14 +0100)]
gettimeofday tests: Enhance test.

* tests/test-gettimeofday.c: Include <stdlib.h> and macros.h.
(test_clobber): New function, extracted from main.
(test_consistency): New function, based on tests/test-timespec_get.c.
(main): Invoke both functions.
* modules/gettimeofday-tests (Files): Add macros.h.

2 years agostdio: suppress macOS 13 sprintf warnings
Paul Eggert [Mon, 6 Mar 2023 00:25:49 +0000 (16:25 -0800)]
stdio: suppress macOS 13 sprintf warnings

* lib/stdio.in.h (_POSIX_C_SOURCE, _GL_DEFINED__POSIX_C_SOURCE):
Suppress deprecation warnings for sprintf and vsprintf
that were introduced in macOS 13.  These are not useful
for Gnulib itself, and are more likely than not to be
merely an annoyance for Gnulib-using code.

2 years agotimespec_get tests: Add comment.
Bruno Haible [Sun, 5 Mar 2023 19:42:12 +0000 (20:42 +0100)]
timespec_get tests: Add comment.

* tests/test-timespec_get.c: Add a comment regarding a glibc bug.

2 years agoRemove unused documentation file.
Bruno Haible [Sun, 5 Mar 2023 18:37:14 +0000 (19:37 +0100)]
Remove unused documentation file.

* doc/glibc-functions/timespec_getres.texi: Remove file.

2 years agoautoupdate
Karl Berry [Sun, 5 Mar 2023 15:49:59 +0000 (07:49 -0800)]
autoupdate

2 years agonl_langinfo tests: Avoid test failure on Solaris 11.
Bruno Haible [Thu, 2 Mar 2023 08:17:33 +0000 (09:17 +0100)]
nl_langinfo tests: Avoid test failure on Solaris 11.

* tests/test-nl_langinfo2.c (main): Skip French T_FMT_AMPM test on
Solaris.

2 years agoterminfo, termcap: Fix more spellos in a comment.
Benno Schulenberg [Mon, 27 Feb 2023 16:10:41 +0000 (17:10 +0100)]
terminfo, termcap: Fix more spellos in a comment.

* lib/tparm.c: Fix misspellings and wording in the main comment.

2 years agoperl: Allow this module to be used with 'gnulib-tool --lgpl'.
Bruno Haible [Tue, 28 Feb 2023 04:46:19 +0000 (05:46 +0100)]
perl: Allow this module to be used with 'gnulib-tool --lgpl'.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00191.html>.

* modules/perl (License): Relax to 'GPLed build tool'.
Approved by Jim Meyering in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00198.html>.

2 years agodfa: Tweak the last patch.
Bruno Haible [Tue, 28 Feb 2023 04:59:25 +0000 (05:59 +0100)]
dfa: Tweak the last patch.

Suggested by Alexei Podtelezhnikov <apodtele@gmail.com>.

* lib/dfa.c (FALLTHROUGH): Assume that Apple clang, in C mode, supports
__attribute__ ((__fallthrough__)) starting with version 1200.
References:
https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2
https://github.com/apple/llvm-project/blob/swift-5.3-RELEASE/clang/test/Sema/fallthrough-attr.c

2 years agofts: fail gracefully when out of memory
ChuanGang Jiang [Mon, 27 Feb 2023 11:46:12 +0000 (11:46 +0000)]
fts: fail gracefully when out of memory

* lib/fts.c (fts_read): Set errno==ENOMEM and return NULL
when setup_dir() fails, rather than hitting an assertion later.

2 years agoannounce-gen: spell OpenBSD with a capital "O"
Jim Meyering [Sun, 26 Feb 2023 17:17:28 +0000 (09:17 -0800)]
announce-gen: spell OpenBSD with a capital "O"

* build-aux/announce-gen (print_checksums): Capitalize
the "O" in OpenBSD, as suggested by Bruno Haible.

2 years agodfa: Avoid warnings with some Apple clang versions.
Bruno Haible [Sun, 26 Feb 2023 15:56:19 +0000 (16:56 +0100)]
dfa: Avoid warnings with some Apple clang versions.

Reported by Werner Lemberg <wl@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00159.html>.

* lib/dfa.c (FALLTHROUGH): When __apple_build_version__ is defined,
ignore __clang_major__.

2 years agoannounce-gen: add more info the auto-generated announce template
Jim Meyering [Sat, 25 Feb 2023 21:20:43 +0000 (13:20 -0800)]
announce-gen: add more info the auto-generated announce template

* build-aux/announce-gen (readable_interval, readable_interval0):
New functions.
(digest_file_base64_wrap): New function to add padding to the
base64-encoded SHA256 checksums.
(print_checksums): Use that wrapper. Indent each line by two spaces.
(main): Emit new sections, e.g., these lines from grep-3.8's release:
- There have been 104 commits by 6 people in the 55 weeks since 3.7.
- The following people contributed changes to this release: (and list)
I tested with this, running from a sibling cloned grep directory:
  ../gnulib/build-aux/announce-gen --release-type=stable \
    --package-name=grep --previous-version=3.7 --current-version=3.8 \
    --gpg-key-id=0x7FD9FCCB000BEEEE --url-directory=https://testing
Also, reference the cksum programs from coreutils-9.2 and from OpenBSD.

2 years agoterminfo, termcap: Fix typos in comments.
ChuanGang Jiang [Sat, 25 Feb 2023 13:56:49 +0000 (14:56 +0100)]
terminfo, termcap: Fix typos in comments.

* lib/tparm.c: Fix misspellings in comments.

2 years agolseek: avoid SEEK_HOLE bugs in FreeBSD, macOS
Paul Eggert [Sun, 19 Feb 2023 06:05:24 +0000 (00:05 -0600)]
lseek: avoid SEEK_HOLE bugs in FreeBSD, macOS

This attempts to fix <https://bugs.gnu.org/61386>, a bug in GNU cp
caused by a serious data corruption bug in FreeBSD and macOS.
* doc/posix-functions/lseek.texi: Mention the bug.
* lib/unistd.in.h (SEEK_DATA, SEEK_HOLE): Undef in macOS < 13 and
FreeBSD < 14.  FreeBSD fixed the bug sometime during FreeBSD 13
<https://bugs.freebsd.org/256205>, so the "FreeBSD < 14" is
conservative.  It’s unknown when Apple will fix macOS so use
macOS "9999" as a placeholder.
* m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek if on one of the
above platforms.

2 years agoconfigmake: Add support for $build_os != $host_os.
Bruno Haible [Sat, 18 Feb 2023 15:59:22 +0000 (16:59 +0100)]
configmake: Add support for $build_os != $host_os.

* m4/build-to-host.m4: New file.
* m4/configmake.m4 (gl_CONFIGMAKE_PREP): Provide a configure-time
definition for pkgdatadir, pkgincludedir, pkglibdir.
(gl_CONFIGMAKE): New macro.
* modules/configmake (Files): Add m4/build-to-host.m4.
(configure.ac): Invoke gl_CONFIGMAKE instead of gl_CONFIGMAKE_PREP.
(Makefile.am): For creating configmake.h, use the various *prefix_c_make
and *dir_c_make variables.

2 years agoconfigmake: Prepare for using directory names with backslashes.
Bruno Haible [Sat, 18 Feb 2023 12:28:48 +0000 (13:28 +0100)]
configmake: Prepare for using directory names with backslashes.

* modules/configmake (Makefile.am): Use printf instead of echo.

2 years agounilbrk tests: Fix compilation failures (regression 2023-02-11).
Bruno Haible [Sat, 18 Feb 2023 11:08:33 +0000 (12:08 +0100)]
unilbrk tests: Fix compilation failures (regression 2023-02-11).

* tests/unilbrk/test-u8-possible-linebreaks.c (main): Outside of
libunistring, don't test the backward compatibility function.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u8-width-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u16-width-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-width-linebreaks.c (main): Likewise.
* tests/unilbrk/test-ulc-width-linebreaks.c (main): Likewise.

2 years agoImprove 'git diff' of *.m4 files.
Bruno Haible [Fri, 17 Feb 2023 22:17:34 +0000 (23:17 +0100)]
Improve 'git diff' of *.m4 files.

* .gitattributes: Add rule for *.m4 files.

2 years agoImprove cross-compilation for midipix.
Bruno Haible [Fri, 17 Feb 2023 21:58:36 +0000 (22:58 +0100)]
Improve cross-compilation for midipix.

Reported by Ørjan Malde <red@foxi.me> at
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00131.html>.

This patch handles the cases where midipix acts like Linux.

* m4/chmod.m4 (gl_FUNC_CHMOD): Treat midipix like Linux with glibc or
musl libc.
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
* m4/link.m4 (gl_FUNC_LINK): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
* m4/mkdir.m4 (gl_FUNC_MKDIR): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise.
* m4/readlink.m4 (gl_FUNC_READLINK): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/select.m4 (gl_FUNC_SELECT): Likewise.
* m4/sleep.m4 (gl_FUNC_SLEEP): Likewise.
* m4/stat.m4 (gl_FUNC_STAT): Likewise.
* m4/symlink.m4 (gl_FUNC_SYMLINK): Likewise.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/usleep.m4 (gl_FUNC_USLEEP): Likewise.

2 years agoImprove cross-compilation from midipix.
Bruno Haible [Fri, 17 Feb 2023 15:24:34 +0000 (16:24 +0100)]
Improve cross-compilation from midipix.

Reported by Ørjan Malde <red@foxi.me> at
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00131.html>.

Since midipix consists of musl libc based on an emulation of Linux system
calls, for pure libc functionality it can be treated like musl libc.

* m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Treat midipix like systems with
musl libc.
* m4/cbrtl.m4 (gl_FUNC_CBRTL): Likewise.
* m4/ceil.m4 (gl_FUNC_CEIL): Likewise.
* m4/ceilf.m4 (gl_FUNC_CEILF): Likewise.
* m4/ceill.m4 (gl_FUNC_CEILL): Likewise.
* m4/exp2l.m4 (gl_FUNC_EXP2L): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/expm1.m4 (gl_FUNC_EXPM1): Likewise.
* m4/expm1f.m4 (gl_FUNC_EXPM1F): Likewise.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Likewise.
* m4/fclose.m4 (gl_FUNC_FCLOSE_STDIN): Likewise.
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Likewise.
* m4/ffsll.m4 (gl_FUNC_FFSLL): Likewise.
* m4/floor.m4 (gl_FUNC_FLOOR): Likewise.
* m4/floorf.m4 (gl_FUNC_FLOORF): Likewise.
* m4/fmod.m4 (gl_FUNC_FMOD): Likewise.
* m4/fmodf.m4 (gl_FUNC_FMODF): Likewise.
* m4/fmodl.m4 (gl_FUNC_FMODL): Likewise.
* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise.
* m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Likewise.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/hypot.m4 (gl_FUNC_HYPOT): Likewise.
* m4/hypotf.m4 (gl_FUNC_HYPOTF): Likewise.
* m4/hypotl.m4 (gl_FUNC_HYPOTL): Likewise.
* m4/iconv_open-utf.m4 (gl_FUNC_ICONV_OPEN_UTF_SUPPORT): Likewise.
* m4/log.m4 (gl_FUNC_LOG): Likewise.
* m4/log10.m4 (gl_FUNC_LOG10): Likewise.
* m4/log10f.m4 (gl_FUNC_LOG10F): Likewise.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Likewise.
* m4/log1p.m4 (gl_FUNC_LOG1P): Likewise.
* m4/log1pf.m4 (gl_FUNC_LOG1PF): Likewise.
* m4/log1pl.m4 (gl_FUNC_LOG1PL, gl_FUNC_LOG1PL_WORKS): Likewise.
* m4/log2.m4 (gl_FUNC_LOG2): Likewise.
* m4/log2f.m4 (gl_FUNC_LOG2F): Likewise.
* m4/log2l.m4 (gl_FUNC_LOG2L_WORKS): Likewise.
* m4/logf.m4 (gl_FUNC_LOGF): Likewise.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Likewise.
* m4/malloc.m4 (_AC_FUNC_MALLOC_IF): Likewise.
* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise.
* m4/modf.m4 (gl_FUNC_MODF): Likewise.
* m4/modff.m4 (gl_FUNC_MODFF): Likewise.
* m4/modfl.m4 (gl_FUNC_MODFL): Likewise.
* m4/musl.m4 (gl_MUSL_LIBC): Likewise.
* m4/perror.m4 (gl_FUNC_PERROR): Likewise.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_SECURE,
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE,
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2,
gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN): Likewise.
* m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_INFINITE,
gl_PRINTF_INFINITE_LONG_DOUBLE, gl_PRINTF_DIRECTIVE_A,
gl_PRINTF_DIRECTIVE_F, gl_PRINTF_FLAG_ZERO, gl_SNPRINTF_TRUNCATION_C99,
gl_SNPRINTF_RETVAL_C99, gl_SNPRINTF_DIRECTIVE_N,
gl_VSNPRINTF_ZEROSIZE_C99): Likewise.
* m4/pthread_rwlock_rdlock.m4 (gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER):
Likewise.
* m4/putenv.m4 (gl_FUNC_PUTENV): Likewise.
* m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Likewise.
* m4/remainder.m4 (gl_FUNC_REMAINDER): Likewise.
* m4/remainderf.m4 (gl_FUNC_REMAINDERF): Likewise.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL, gl_FUNC_REMAINDERL_WORKS):
Likewise.
* m4/rintl.m4 (gl_FUNC_RINTL): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.
* m4/roundl.m4 (gl_FUNC_ROUNDL): Likewise.
* m4/setenv.m4 (gl_FUNC_SETENV): Likewise.
* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Likewise.
* m4/signbit.m4 (gl_SIGNBIT): Likewise.
* m4/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise.
* m4/strerror.m4 (gl_FUNC_STRERROR, gl_FUNC_STRERROR_0): Likewise.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Likewise.
* m4/trunc.m4 (gl_FUNC_TRUNC): Likewise.
* m4/truncf.m4 (gl_FUNC_TRUNCF): Likewise.
* m4/truncl.m4 (gl_FUNC_TRUNCL): Likewise.
* m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Likewise.
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.

2 years agoFix an old ChangeLog entry.
Bruno Haible [Wed, 15 Feb 2023 21:21:27 +0000 (22:21 +0100)]
Fix an old ChangeLog entry.

2 years agohamt: Detect GCC version correctly.
ChuanGang Jiang [Mon, 13 Feb 2023 12:35:43 +0000 (13:35 +0100)]
hamt: Detect GCC version correctly.

* lib/hamt.h:Use __GNUC_MINOR__, not  __GNUC_MINOR.

2 years agoterminfo, termcap: Avoid wrong configure result with clang ≥ 15.
Bruno Haible [Sat, 11 Feb 2023 23:36:10 +0000 (00:36 +0100)]
terminfo, termcap: Avoid wrong configure result with clang ≥ 15.

clang 15 reports an error for -Wint-conversion by default.

Reported by Sam James <sam@gentoo.org> in
<https://savannah.gnu.org/bugs/?63793>.

* m4/terminfo.m4 (gl_TERMINFO_BODY): Avoid a -Wint-conversion warning
when testing for tparam and tparm.
* m4/termcap.m4 (gl_TERMCAP_BODY): Likewise.

2 years agoerror-h: Make less fragile.
Bruno Haible [Sat, 11 Feb 2023 20:12:00 +0000 (21:12 +0100)]
error-h: Make less fragile.

* lib/error.in.h: Use #include_next if the system has an <error.h>. Use
a split double-inclusion guard.
* m4/error_h.m4 (gl_ERROR_H): Invoke gl_CHECK_NEXT_HEADERS. Set
HAVE_ERROR_H.
* modules/error-h (Makefile.am): Substitute GUARD_PREFIX, HAVE_ERROR_H,
INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER, NEXT_ERROR_H.

2 years agounilbrk: Don't compile unused functions outside of libunistring.
Bruno Haible [Sat, 11 Feb 2023 19:10:21 +0000 (20:10 +0100)]
unilbrk: Don't compile unused functions outside of libunistring.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Don't
compile outside of libunistring.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* lib/unilbrk/ulc-possible-linebreaks.c (ulc_possible_linebreaks):
Likewise.
* lib/unilbrk/u8-width-linebreaks.c (u8_width_linebreaks): Likewise.
* lib/unilbrk/u16-width-linebreaks.c (u16_width_linebreaks): Likewise.
* lib/unilbrk/u32-width-linebreaks.c (u32_width_linebreaks): Likewise.
* lib/unilbrk/ulc-width-linebreaks.c (ulc_width_linebreaks): Likewise.

2 years agosigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.
Bruno Haible [Sat, 11 Feb 2023 17:48:08 +0000 (18:48 +0100)]
sigsegv: Fix a compilation error on OpenBSD with clang ≥ 16.

* lib/sigsegv.c (install_for): Add a cast when assigning to
action.sa_sigaction.

2 years agoFix code duplication in last commit.
Bruno Haible [Fri, 10 Feb 2023 20:32:11 +0000 (21:32 +0100)]
Fix code duplication in last commit.

* m4/gnulib-common.m4 (gl_CHECK_FUNCS_DEFAULT_CASE,
gl_CHECK_FUNCS_CASE_FOR_ANDROID, gl_CHECK_FUNCS_CASE_FOR_MACOS,
gl_CHECK_FUNCS_SET_RESULTS): New macros, extracted from
gl_CHECK_FUNCS_ANDROID, gl_CHECK_FUNCS_MACOS,
gl_CHECK_FUNCS_ANDROID_MACOS.
(gl_CHECK_FUNCS_ANDROID, gl_CHECK_FUNCS_MACOS,
gl_CHECK_FUNCS_ANDROID_MACOS): Use them.

2 years agomkfifoat: Fix crash on macOS 12.
Bruno Haible [Fri, 10 Feb 2023 19:15:08 +0000 (20:15 +0100)]
mkfifoat: Fix crash on macOS 12.

* m4/gnulib-common.m4 (gl_PREPARE_CHECK_FUNCS_MACOS,
gl_CHECK_FUNCS_MACOS, gl_CHECK_FUNCS_ANDROID_MACOS): New macros.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat and mkfifoat using
gl_CHECK_FUNCS_ANDROID_MACOS instead of gl_CHECK_FUNCS_ANDROID.

2 years agoFix typos like "the the" and "a a" in comments.
ChuanGang Jiang [Fri, 10 Feb 2023 14:34:25 +0000 (14:34 +0000)]
Fix typos like "the the" and "a a" in comments.

* lib/c32is-impl.h: s/the the/the/
* lib/getopt-pfx-core.h: s/a a/a/
* lib/term-style-control.h: s/the the/the/
* lib/textstyle.in.h: Likewise.

2 years agochown, lchown, fchownat tests: Avoid test failure on macOS 12.
Bruno Haible [Fri, 10 Feb 2023 12:46:22 +0000 (13:46 +0100)]
chown, lchown, fchownat tests: Avoid test failure on macOS 12.

* tests/test-chown.h (test_chown): Skip some assertions if
getgid() == (gid_t)-1.
* tests/test-lchown.h (test_lchown): Likewise.

2 years agonullptr: work around Apple clang 14 issue
Paul Eggert [Fri, 10 Feb 2023 01:09:23 +0000 (17:09 -0800)]
nullptr: work around Apple clang 14 issue

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-02/msg00098.html
* doc/gnulib.texi (nullptr): Document limitations better.
* m4/nullptr.m4 (gl_NULLPTR): Check for incompatibility of macOS
clang 14.0.0 (clang-1400.0.29.202), where <stddef.h> defines a
non-working nullptr macro.

2 years agomath: Fix compilation error in C++ mode on macOS 12.5.
Bruno Haible [Thu, 9 Feb 2023 18:27:37 +0000 (19:27 +0100)]
math: Fix compilation error in C++ mode on macOS 12.5.

* lib/math.in.h (isnan): On macOS, treat clang version 14 again like
clang versions < 12.

2 years agoFix compilation errors in C++ mode on macOS 12.5.
Bruno Haible [Thu, 9 Feb 2023 17:37:55 +0000 (18:37 +0100)]
Fix compilation errors in C++ mode on macOS 12.5.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't define
_GL_ATTRIBUTE_MAYBE_UNUSED to [[__maybe_unused__]] if the compiler is
an Apple variant of clang.

2 years agolimits-h: Work around a clang 15 bug.
Bruno Haible [Thu, 9 Feb 2023 15:08:00 +0000 (16:08 +0100)]
limits-h: Work around a clang 15 bug.

* m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
* lib/limits.in.h: Handle the case where BOOL_WIDTH is present and
BOOL_MAX is missing.
* doc/posix-headers/limits.texi: Mention the clang bug.

2 years agolimits-h: Work around a clang 15 bug.
Bruno Haible [Thu, 9 Feb 2023 12:30:04 +0000 (13:30 +0100)]
limits-h: Work around a clang 15 bug.

* m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
* doc/posix-headers/limits.texi: Mention the clang bug.

2 years agoFix error in C++ mode on glibc systems (regression 2022-04-28).
Bruno Haible [Thu, 9 Feb 2023 12:16:31 +0000 (13:16 +0100)]
Fix error in C++ mode on glibc systems (regression 2022-04-28).

* lib/malloc.in.h (rpl_free): Add exception specification like
stdlib.in.h does.
* lib/string.in.h (rpl_free): Likewise.
* lib/wchar.in.h (rpl_free): Likewise.