glibc/sysdeps
Zack Weinberg 349718d4d7 Add __vfscanf_internal and __vfwscanf_internal with flags arguments.
There are two flags currently defined: SCANF_LDBL_IS_DBL is the mode
used by __nldbl_ scanf variants, and SCANF_ISOC99_A is the mode used
by __isoc99_ scanf variants.  In this patch, the new functions honor
these flag bits if they're set, but they still also look at the
corresponding bits of environmental state, and callers all pass zero.

The new functions do *not* have the "errp" argument possessed by
_IO_vfscanf and _IO_vfwscanf.  All internal callers passed NULL for
that argument.  External callers could theoretically exist, so I
preserved wrappers, but they are flagged as compat symbols and they
don't preserve the three-way distinction among types of errors that
was formerly exposed.  These functions probably should have been in
the list of deprecated _IO_ symbols in 2.27 NEWS -- they're not just
aliases for vfscanf and vfwscanf.

(It was necessary to introduce ldbl_compat_symbol for _IO_vfscanf.
Please check that part of the patch very carefully, I am still not
confident I understand all of the details of ldbl-opt.)

This patch also introduces helper inlines in libio/strfile.h that
encapsulate the process of initializing an _IO_strfile object for
reading.  This allows us to call __vfscanf_internal directly from
sscanf, and __vfwscanf_internal directly from swscanf, without
duplicating the initialization code.  (Previously, they called their
v-counterparts, but that won't work if we want to control *both* C99
mode and ldbl-is-dbl mode using the flags argument to__vfscanf_internal.)
It's still a little awkward, especially for wide strfiles, but it's
much better than what we had.

Tested for powerpc and powerpc64le.
2018-12-05 18:15:42 -02:00
..
aarch64 [AArch64] Adjust writeback in non-zero memset 2018-11-20 12:37:00 +00:00
alpha Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
arm Fix armv7 build with GCC 9. 2018-11-12 23:59:29 +00:00
generic Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
gnu hurd: Fix build 2018-10-31 09:17:05 +01:00
hppa Move SNAN_TESTS_PRESERVE_PAYLOAD out of math-tests.h. 2018-08-01 11:21:16 +00:00
htl htl: Fix comparing attr with default values 2018-12-01 21:42:12 +01:00
hurd Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
i386 Remove the error handling wrapper from pow 2018-11-21 09:58:36 +00:00
ia64 Remove the error handling wrapper from pow 2018-11-21 09:58:36 +00:00
ieee754 Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k Remove the error handling wrapper from pow 2018-11-21 09:58:36 +00:00
mach scripts/abilist.awk: Handle special _end symbol for Hurd 2018-11-30 22:22:57 +01:00
microblaze Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
mips Fix mips build with GCC 9. 2018-11-13 01:55:15 +00:00
nios2 Move EXCEPTION_TESTS_* out of math-tests.h 2018-08-23 23:41:13 +00:00
nptl Mutex: Add pthread mutex tunables 2018-12-01 08:19:20 -08:00
posix posix: Fix segfault in maybe_script_execute 2018-12-03 18:23:11 -02:00
powerpc Add hidden_tls_def macros, fix powerpc-soft build with GCC 9. 2018-11-13 01:53:53 +00:00
pthread hurd: fix sigevent's sigev_notify_attributes field type 2018-04-19 21:43:44 +02:00
riscv RISC-V: properly terminate call chain (bug 23125) 2018-10-30 12:07:25 +01:00
s390 S390: Regenerate ULPs. 2018-11-28 15:20:18 +01:00
sh Update SH libm-tests-ulps 2018-07-31 10:33:53 -03:00
sparc Fix sparc64 build with GCC 9. 2018-11-13 00:27:06 +00:00
unix Enable VDSO for static linking on arm 2018-12-03 20:59:22 +00:00
wordsize-32 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
wordsize-64 Don't reduce test timeout to less than default 2018-10-17 09:34:13 +02:00
x86 x86: Extend CPUID support in struct cpu_features 2018-12-03 05:54:56 -08:00
x86_64 x86: Extend CPUID support in struct cpu_features 2018-12-03 05:54:56 -08:00