On Tue, 7 Jul 2026, Jakub Jelinek wrote:

> Hi!
> 
> As I wrote earlier, I'd like to see _BitInt I/O support in
> *printf*/*scanf* and extending support of _BitInt in stdbit.h
> in C2Y.
> 
> For those I wrote drafts of possible C2Y papers:
> https://jakubjelinek.github.io/wg14/va_arg_bitint.html

generic_limb_type should probably be required to be an unsigned type; the 
descriptions don't work with it as a signed type.  Since the terminology 
was changed so that bool isn't counted as an unsigned integer type any 
more, that would then mean "other than bool" is no longer needed.

Various editorial fixes: "pointed by" should be "pointed to by" (six 
times).  "from object" should be "from the object" (twice), "from array" 
should be "from the array", "into array" should be "into the array".

The proposed feature wouldn't actually allow for implementing scanf in 
standard C because of the need to pass the right pointer-to-_BitInt type 
to va_arg there (though this isn't very likely to be an issue in practice 
with scanf implementation, and POSIX has an XSI-marked allowance for 
mixing arbitrary pointer types in va_arg, in support of use of %n$ in 
scanf).

> https://jakubjelinek.github.io/wg14/stdbit_bitint.html

Maybe remark in the introduction that there is also the _Generic technique 
(pointed out by Martin, I think) for determining _BitInt widths even with 
a very large range (match on types such as _BitInt(sizeof(arg)*8), 
_BitInt(sizeof(arg)*8-1), ..., _BitInt(sizeof(arg)*8-63), depending on the 
details of how the ABI determines _BitInt size and with appropriate 
handling to cover the top and bottom of the range of possible widths).

And I think the wording in various places could just say "an unsigned 
integer type" without needing bullet points for the different kinds of 
such types any more.

-- 
Joseph S. Myers
[email protected]

Reply via email to