From 2d88df541132f09454d947c498103aa7be76b652 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 19 Jun 2023 19:40:34 +0000 Subject: C2x scanf %b support ISO C2x defines scanf %b for input of binary integers (with an optional 0b or 0B prefix). Implement such support, along with the corresponding SCNb* macros in . Unlike the support for binary integers with 0b or 0B prefix with scanf %i, this is supported in all versions of scanf (independent of the standards mode used for compilation), because there are no backwards compatibility concerns (%b wasn't previously a supported format) the way there were for %i. Tested for x86_64 and x86. --- NEWS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 7cec03cc76..709ee40e50 100644 --- a/NEWS +++ b/NEWS @@ -17,9 +17,12 @@ Major new features: wcstoull_l, wcstoimax, wcstoumax, wcstoq, wcstouq. Similarly, the following functions support binary integers prefixed by 0b or 0B as input to the %i format: fscanf, scanf, sscanf, vscanf, vsscanf, - vfscanf, fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf. + vfscanf, fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf; those + functions also support the %b format for binary integers, with or + without such a prefix and independent of standards mode. -* PRIb* and PRIB* macros from C2X have been added to . +* PRIb*, PRIB* and SCNb* macros from C2X have been added to + . * printf-family functions now support the wN format length modifiers for arguments of type intN_t, int_leastN_t, uintN_t or uint_leastN_t (for -- cgit 1.4.1