platform_bionic/libc/upstream-openbsd
Elliott Hughes 1f462dec34 Add %b and %B support to the scanf/wscanf and strto*/wcsto* families.
Coming to C23 via WG14 N2630.

This one is a little interesting, because it actually changes existing
behavior. Previously "0b101" would be parsed as "0", "b", "101" by these
functions. I'm led to believe that glibc plans to actually have separate
versions of these functions for C23 and pre-C23, so callers can have the
behavior they (implicitly) specify by virtue of which -std= they compile
with. Android has never really done anything like that, and I'm pretty
sure app developers have more than enough to worry about with API levels
without having to deal with the cartesian product of API level and C
standard.

Therefore, my plan A is "if you're running on Android >= U, you get C23
behavior". My plan B in the (I think unlikely) event that that actually
causes trouble for anyone is "if you're _targeting_ Android >= U, you
get C23 behavior". I don't think we'd actually want to have two versions
of each of these functions under any circumstances --- that seems by far
the most confusing option.

Test: treehugger
Change-Id: I0bbb30315d3fabd306905ad1484361f5d8745935
2022-08-11 00:25:08 +00:00
..
android Export fts as a static library for use with musl 2021-09-08 15:53:10 -07:00
lib/libc Add %b and %B support to the scanf/wscanf and strto*/wcsto* families. 2022-08-11 00:25:08 +00:00
.clang-format Fully disable clang format where needed. 2020-01-30 08:10:17 -08:00
README.md Move to .md files for even trivial documentation. 2017-01-07 12:47:28 -08:00

This directory contains upstream OpenBSD source. You should not edit these files directly. Make fixes upstream and then pull down the new version of the file.

TODO: write a script to make this process automated.