Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 02 Aug 2022 19:47:19 -0700
From: Keith Packard <keithp@...thp.com>
To: enh <enh@...gle.com>, libc-coord@...ts.openwall.com
Subject: Re: anyone else working on %b?

enh <enh@...gle.com> writes:

> https://android-review.googlesource.com/c/platform/bionic/+/2169037
> adds %b/%B to bionic's printf/wprintf family. i'll do
> scanf/wscanf/strto* separately since (a) i've never needed those like
> i've needed printf and (b) they might be trickier to land given the
> behavior change.

I just coded these both for picolibc; printf required a two line change,
while scanf required quite a bit more. However, it also raised a couple
of questions which I suspect were already discussed, but I didn't find
anything. Should scanf's %i format parse the leading 0b/0B to indicate
binary? Should %b/%B permit a leading 0b/0B? The former seems
questionable as it does really change behavior (perhaps that's what the
above comment refers to?). But, not doing that makes it inconsistent
with how %i supports hexadecimal values.

-- 
-keith

Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)

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.