public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* printf: 0 flag and given precision for %b
@ 2023-03-31 15:40 Vincent Lefevre
  0 siblings, 0 replies; only message in thread
From: Vincent Lefevre @ 2023-03-31 15:40 UTC (permalink / raw)
  To: libc-alpha

In the WG14 / N3088 C2x draft, the 0 flag is not ignored for %b when
a precision is specified:

  0   For b, d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions,
      leading zeros (following any indication of sign or base) are used
      to pad to the field width rather than performing space padding,
      except when converting an infinity or NaN. If the 0 and - flags
      both appear, the 0 flag is ignored. For d, i, o, u, x, and X
      conversions, if a precision is specified, the 0 flag is ignored.
      For other conversions, the behavior is undefined.

But glibc appears to ignore the 0 flag in this case. Is this a bug,
or has the %b case been forgotten in this current draft?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 15:40 printf: 0 flag and given precision for %b Vincent Lefevre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).