glibc/libio
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
..
bits
Depend
Makefile libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
Versions libio: Implement internal function __libc_readline_unlocked 2018-07-06 17:52:54 +02:00
__fbufsize.c
__flbf.c
__fpending.c
__fpurge.c
__freadable.c
__freading.c
__fsetlocking.c
__fwritable.c
__fwriting.c
bug-fopena+.c
bug-fseek.c
bug-ftell.c
bug-memstream1.c
bug-mmap-fflush.c
bug-rewind.c
bug-rewind2.c
bug-ungetc.c
bug-ungetc2.c
bug-ungetc3.c
bug-ungetc4.c
bug-ungetwc1.c
bug-ungetwc2.c
bug-wfflush.c
bug-wmemstream1.c
bug-wsetpos.c
clearerr.c
clearerr_u.c
fcloseall.c
feof.c
feof_u.c
ferror.c
ferror_u.c
filedoalloc.c
fileno.c
fileops.c [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
fmemopen.c
fputc.c
fputc_u.c
fputwc.c
fputwc_u.c
freopen.c libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
freopen64.c libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
fseek.c
fseeko.c libio: Implement internal function __libc_readline_unlocked 2018-07-06 17:52:54 +02:00
fseeko64.c libio: Implement internal function __libc_readline_unlocked 2018-07-06 17:52:54 +02:00
ftello.c libio: Implement internal function __libc_readline_unlocked 2018-07-06 17:52:54 +02:00
ftello64.c libio: Implement internal function __libc_readline_unlocked 2018-07-06 17:52:54 +02:00
fwide.c
fwprintf.c
fwscanf.c
genops.c
getc.c
getc_u.c
getchar.c
getchar_u.c
getwc.c
getwc_u.c
getwchar.c
getwchar_u.c
iofclose.c
iofdopen.c
iofflush.c
iofflush_u.c
iofgetpos.c
iofgetpos64.c
iofgets.c
iofgets_u.c
iofgetws.c
iofgetws_u.c
iofopen.c
iofopen64.c
iofopncook.c
iofputs.c
iofputs_u.c
iofputws.c
iofputws_u.c
iofread.c
iofread_u.c
iofsetpos.c
iofsetpos64.c
ioftell.c
iofwide.c
iofwrite.c
iofwrite_u.c
iogetdelim.c
iogetline.c
iogets.c
iogetwline.c
iolibio.h hurd: Avoid more libc.so local PLTs 2018-04-03 00:36:33 +00:00
iopadn.c
iopopen.c posix: Use posix_spawn on popen 2018-11-30 18:42:05 -02:00
ioputs.c hurd: Avoid more libc.so local PLTs 2018-04-03 00:36:33 +00:00
ioseekoff.c
ioseekpos.c
iosetbuffer.c
iosetvbuf.c
ioungetc.c
ioungetwc.c
iovdprintf.c
iovsprintf.c
iovsscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
iovswscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
iowpadn.c
libc_fatal.c
libio.h Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
libioP.h Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
memstream.c libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
obprintf.c
oldfileops.c [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
oldfmemopen.c
oldiofclose.c
oldiofdopen.c
oldiofgetpos.c
oldiofgetpos64.c
oldiofopen.c
oldiofsetpos.c
oldiofsetpos64.c
oldiopopen.c
oldpclose.c
oldstdfiles.c
oldtmpfile.c
pclose.c
peekc.c
putc.c
putc_u.c
putchar.c
putchar_u.c
putwc.c
putwc_u.c
putwchar.c
putwchar_u.c
readline.c Fix copyright years in recent commits 2018-07-10 11:03:08 +02:00
rewind.c
setbuf.c
setlinebuf.c
stdfiles.c
stdio.c
stdio.h Add renameat2 function [BZ #17662] 2018-07-05 19:00:10 +02:00
strfile.h Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
strops.c libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
swprintf.c
swscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
test-fmemopen.c
test-freopen.c
test-freopen.sh
tst-atime.c Don't reduce test timeout to less than default 2018-10-17 09:34:13 +02:00
tst-bz22415.c
tst-eof.c
tst-ext.c
tst-ext2.c
tst-fgetc-after-eof.c [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
tst-fgetwc.c
tst-fgetwc.input
tst-fgetws.c
tst-fopenloc.c
tst-fopenloc2.c
tst-fputws.c
tst-freopen.c
tst-fseek.c
tst-ftell-active-handler.c
tst-ftell-append.c
tst-ftell-partial-wide.c
tst-fwrite-error.c
tst-memstream.h libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
tst-memstream1.c
tst-memstream2.c
tst-memstream3.c
tst-memstream4.c libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
tst-mmap-eofsync.c
tst-mmap-fflushsync.c
tst-mmap-offend.c
tst-mmap-setvbuf.c
tst-mmap2-eofsync.c
tst-popen1.c
tst-readline.c Increase timeout of libio/tst-readline 2018-10-09 15:56:12 +01:00
tst-setvbuf1.c
tst-sscanf.c
tst-swscanf.c
tst-ungetwc1.c
tst-ungetwc2.c
tst-vtables-common.c support: Add signal support to support_capture_subprocess_check 2018-11-28 20:57:18 +01:00
tst-vtables-interposed.c libio: Add tst-vtables, tst-vtables-interposed 2018-06-26 12:31:08 +02:00
tst-vtables.c libio: Add tst-vtables, tst-vtables-interposed 2018-06-26 12:31:08 +02:00
tst-widetext.c
tst-widetext.input
tst-wmemstream1.c
tst-wmemstream2.c
tst-wmemstream3.c
tst-wmemstream4.c libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
tst_getwc.c
tst_getwc.input
tst_putwc.c
tst_swprintf.c
tst_swscanf.c
tst_wprintf.c
tst_wprintf2.c
tst_wscanf.c
tst_wscanf.input
vasprintf.c libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
vscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
vsnprintf.c
vswprintf.c
vtables.c libio: Disable vtable validation in case of interposition [BZ #23313] 2018-06-26 10:24:52 +02:00
vwprintf.c
vwscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
wfiledoalloc.c
wfileops.c [BZ 1190] Make EOF sticky in stdio. 2018-03-13 08:31:56 -04:00
wgenops.c
wmemstream.c libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00
wprintf.c
wscanf.c Add __vfscanf_internal and __vfwscanf_internal with flags arguments. 2018-12-05 18:15:42 -02:00
wstrops.c libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 2018-06-01 10:41:03 +02:00