glibc/sysdeps
Joseph Myers dee2bea048 C2x scanf binary constant handling
C2x adds binary integer constants starting with 0b or 0B, and supports
those constants for the %i scanf format (in addition to the %b format,
which isn't yet implemented for scanf in glibc).  Implement that scanf
support for glibc.

As with the strtol support, this is incompatible with previous C
standard versions, in that such an input string starting with 0b or 0B
was previously required to be parsed as 0 (with the rest of the input
potentially matching subsequent parts of the scanf format string).
Thus this patch adds 12 new __isoc23_* functions per long double
format (12, 24 or 36 depending on how many long double formats the
glibc configuration supports), with appropriate header redirection
support (generally very closely following that for the __isoc99_*
scanf functions - note that __GLIBC_USE (DEPRECATED_SCANF) takes
precedence over __GLIBC_USE (C2X_STRTOL), so the case of GNU
extensions to C89 continues to get old-style GNU %a and does not get
this new feature).  The function names would remain as __isoc23_* even
if C2x ends up published in 2024 rather than 2023.

When scanf %b support is added, I think it will be appropriate for all
versions of scanf to follow C2x rules for inputs to the %b format
(given that there are no compatibility concerns for a new format).

Tested for x86_64 (full glibc testsuite).  The first version was also
tested for powerpc (32-bit) and powerpc64le (stdio-common/ and wcsmbs/
tests), and with build-many-glibcs.py.
2023-03-02 19:10:37 +00:00
..
aarch64 aarch64: update libm test ulps 2023-02-24 10:55:38 +00:00
alpha alpha: Add string-fza, string-fzb.h, string-fzi.h, and string-shift.h 2023-02-06 16:19:35 -03:00
arc ARC:fpu: add extra capability check before use of sqrt and fma builtins 2023-02-17 16:17:58 -03:00
arm arm: Support gcc older than 10 for find_zero_all 2023-02-20 16:43:42 -03:00
csky C-SKY: Strip hard float abi from hard float feature. 2023-02-07 16:34:24 +08:00
generic elf: Restore ldconfig libc6 implicit soname logic [BZ #30125] 2023-02-20 09:32:46 -03:00
gnu Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
hppa hppa: Add string-fza.h, string-fzc.h, and string-fzi.h 2023-02-06 16:19:35 -03:00
htl htl: Remove ./sysdeps/htl/bits/types/struct___pthread_mutex.h 2023-02-12 17:28:32 +01:00
hurd Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
i386 htl: Generalize i386 pt-machdep.h to x86 2023-02-12 16:33:39 +01:00
ia64 ia64: Regenerate ulps 2023-01-24 11:21:38 -05:00
ieee754 C2x scanf binary constant handling 2023-03-02 19:10:37 +00:00
loongarch LoongArch: Update libm-test-ulps. 2023-03-02 11:17:15 +08:00
m68k string: Remove string_private.h 2023-02-17 15:56:54 -03:00
mach C2x scanf binary constant handling 2023-03-02 19:10:37 +00:00
microblaze Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
mips Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nios2 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
nptl Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
or1k Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
posix Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
powerpc powerpc:Regenerate ulps for hypot 2023-02-23 22:06:03 -06:00
pthread Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
riscv riscv: Add string-fza.h and string-fzi.h 2023-02-06 16:19:35 -03:00
s390 S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130] 2023-02-28 14:01:28 +01:00
sh sh: Add string-fzb.h 2023-02-06 16:19:35 -03:00
sparc sparc (64bit): Regenerate ulps 2023-01-24 11:21:50 -05:00
unix C2x scanf binary constant handling 2023-03-02 19:10:37 +00:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2023-01-06 21:14:39 +00:00
wordsize-64 C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
x86 x86-64: Add glibc.cpu.prefer_map_32bit_exec [BZ #28656] 2023-02-22 18:28:37 -08:00
x86_64 htl: Add pthreadtypes-arch.h for x86_64 2023-02-27 23:30:15 +01:00