bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vasnwprintf: Port to older platforms without swprintf


From: Bruno Haible
Subject: Re: vasnwprintf: Port to older platforms without swprintf
Date: Wed, 22 Mar 2023 19:42:15 +0100

Yesterday I did:
>       * tests/test-vasnwprintf-posix.c (test_function): Add more tests for the
>       %c and %lc directives.

Some of these new tests fail on musl libc, FreeBSD, NetBSD, AIX, mingw.
- For musl libc, *BSD, AIX, it's a bug in the swprintf function, and as
  a workaround, I'll just not use swprintf on these platforms.
  For musl libc, I have reported it at
  <https://www.openwall.com/lists/musl/2023/03/22/9>.
- For mingw, I'll continue to use the snwprintf function, but with a small
  workaround.


2023-03-22  Bruno Haible  <bruno@clisp.org>

        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.

2023-03-22  Bruno Haible  <bruno@clisp.org>

        vasnwprintf: Fix a "warning: unused function 'wmax_room_needed'".
        * lib/vasnprintf.c (MAX_ROOM_NEEDED): Adjust #if condition.

2023-03-22  Bruno Haible  <bruno@clisp.org>

        vasnwprintf: Simplify last change.
        * lib/vasnprintf.c (VASNPRINTF): Remove unused variable 'len'.

Attachment: 0001-vasnwprintf-Simplify-last-change.patch
Description: Text Data

Attachment: 0002-vasnwprintf-Fix-a-warning-unused-function-wmax_room_.patch
Description: Text Data

Attachment: 0003-vasnwprintf-Fix-test-failures-on-FreeBSD-NetBSD-AIX-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]