coreutils
[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: Eric Blake
Subject: Re: [PATCH] printf: add %#s alias to %b
Date: Wed, 6 Sep 2023 11:32:32 -0500
User-agent: NeoMutt/20230517

On Wed, Sep 06, 2023 at 10:45:09AM +0700, Robert Elz wrote:
> 
> However, my "read of the room" at the minute is that this simply won't
> happen, and printf(1) %b will remain as it is, and not be removed any
> time soon (or probably, ever).   If printf(1) ever really needs a method
> to output in binary, some other mechanism is likely to be found - most
> likely one which gives a choice of output bases, not just base 2.

You (anyone reading this, not just kre) are welcome to join tomorrow's
Austin Group meeting if you would like to add input on how to reword
the changes that will land in Issue 8 as a result of
https://austingroupbugs.net/view.php?id=1771; it is a Zoom call
(details at
https://www.mail-archive.com/austin-group-l@opengroup.org/msg11758.html).
Or you can add comments to the bug directly. I will be on the call,
and if nothing else, my role in the meeting tomorrow will include
summarizing some of the "read of the room" on the feedback received in
this thread (namely, enough shell authors are insistent that printf(1)
and printf(3) should diverge in %b behavior in Issue 9 that trying to
plan otherwise by marking it obsolescent in Issue 8 isn't going to
minimize any pain down the road)

> 
> There's no current harm implementing %#s as an alias for %b - but I see
> no point in anyone using it, it will certainly be far less portable than
> %b for a LONG time.   There's also no guarantee that the C people might not
> find a use in printf(3) for %#s (currently the # there has no meaning) and
> entirely possible that whatever that use is, if it happens, might be more
> useful for printf(1) to follow, than having it mean what %b currently
> means - so going that route really is not a safe long term choice (it
> would be a gamble).

Of course, the gamble is easier to win if we have multiple independent
implementations that have all coordinated to do it the same way, so we
can push back on WG14 to tell them they would be foolish to commandeer
%#s for anything other than what existing practice has.  Coreutils is
willing to do it, but I have not actually committed that patch yet,
waiting to see how this thread pans out.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org




reply via email to

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