bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] printf: add %#s alias to %b


From: Pádraig Brady
Subject: Re: [PATCH] printf: add %#s alias to %b
Date: Thu, 7 Sep 2023 21:00:07 +0100
User-agent: Mozilla Thunderbird

On 07/09/2023 19:46, Eric Blake wrote:
On Thu, Sep 07, 2023 at 11:53:54PM +0700, Robert Elz wrote:
And for those who have been following this issue, the new text for
the forthcoming POSIX version has removed any mention of obsoleting
%b from printf(1) - instead it will simply note that there is will be
a difference between printf(1) and printf(3) once the latter gets its
version of %b specified (in C23, and in POSIX, in the next major version
that follows the coming one, almost certainly) - and to encourage
implementors to consider possible solutions.

I've considered, and I don't see a problem needing solving, so I'm
intending to do precisely nothing, unless someone actually finds a
need for binary output from printf(1), which seems unlikely to
ever happen to me (I mean a real need, not just to be the same as printf(3)
"just because").

So, we can all go back to sleep now - and Chet, I'd undo $#s before it
appears in a release, there's no need, and having it might eventually
just cause more backward compat issues.

Indeed, at this point, even though I proposed a patch for %#s in
coreutils, I'm inclined to NOT apply it there.

Agreed.

The ksh extension of %..2d to output in binary does sound worth
replicating; I wonder if glibc would consider putting that in their
printf(3); and I could see adding it to Coreutils (whether or not bash
adds it - because ksh already has it).

This does seem useful as there is prior art, and it's quite general.
FWIW there is related functionality in coreutils currently through `basenc 
--base2msbf`

cheers,
Pádraig



reply via email to

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