Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 14 Nov 2023 10:38:04 -0500
From: Rich Felker <>
To: Bruno Haible <>
Subject: Re: *printf %lc of L'\0'

On Tue, Nov 14, 2023 at 02:22:46PM +0100, Bruno Haible wrote:
> Hi,
> On 2023-03-21 I noticed a bug with %lc in most libcs:
> <>.
> On 2023-03-28 Eric Blake opened a defect with POSIX, with the intent that
> both ISO C and POSIX make the four *printf cases consistent:
> <>
> This issue was then submitted in the ISO C 23 ballot as GB-141,
> and in the meeting from 2023-06-20 to 2023-06-23 it was decided upon:
> <>
> page 23, 24. The decision ("option 1") is detailed in
> <>:
>   "Option 1 (require a NUL) - change the text to:
>    If an l length modifier is present, the wint_t argument is converted
>    as if by a call to the wcrtomb function with a pointer to storage of
>    at least MB_CUR_MAX bytes, the wint_t argument converted to wchar_t,
>    and an initial shift state."
> So, ISO C changed, and POSIX will follow suit.
> The bug in most libcs is thus no longer a bug.

Yep, I have a patch for it as of a few days ago, which should make it
in the next release.

> musl libc, which had it correct, now has a bug.

Well, not a "bug" until the next standard is published and we claim
aiming to support it, but yes, something that should be changed. :-)


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.