[Top][All Lists]

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

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

From: Robert Elz
Subject: Re: [PATCH] printf: add %#s alias to %b
Date: Wed, 06 Sep 2023 13:37:32 +0700

    Date:        Wed, 6 Sep 2023 08:13:23 +0300
    From:        =?UTF-8?B?T8SfdXo=?= <>

  | What's the point? Does anyone need this feature in their shell scripts (and
  | can't afford to use bc for it)?

Adding a different %b to printf(1) wasn't currently even proposed, just
deprecating the current one so it wouldn't conflict with the usage of
%b in printf(3) (which is being defined in C23, and is apparently already
firmly entrenched, even though C23 is not yet (quite) formally released).

There was no proposal (yet) to provide a replacement for %b (which would
not actually be deprecated, if it were to be, for ages yet) - though the
%#s idea was proposed, and implemented in a couple of places (incl bash
I believe) - technically according to the rules, it would be too late now
to even mention that in the upcoming POSIX version, though there was some
talk of bending that rule, so a hint could be provided to applications as
to how they might move away from %b (the existing proposal is nonsense).

My guess is that none of this will happen now, and %b, or possible alternates,
won't get any special mention in the forthcoming POSIX standard - so %b
in printf(1) would remain just like it is now for several decades at least.
(%b will appear in POSIX printf(3) in the next version after this one,
when POSIX aligns itself with C23 (or later) which contains that - C23 is
too late to be considered for the forthcoming POSIX version, and C17 does not
contain %b in its printf function).


reply via email to

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