glibc/stdio-common/scanf14.c

138 lines
3.2 KiB
C
Raw Normal View History

* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <libc-diag.h>
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
#define FAIL() \
do { \
result = 1; \
printf ("test at line %d failed\n", __LINE__); \
} while (0)
int
main (void)
{
wchar_t *lsp;
char *sp;
float f;
double d;
char c[8];
int result = 0;
if (sscanf (" 0.25s x", "%e%3c", &f, c) != 2)
FAIL ();
else if (f != 0.25 || memcmp (c, "s x", 3) != 0)
FAIL ();
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
/* GCC in C99 mode treats %a as the C99 format expecting float *,
but glibc with _GNU_SOURCE treats %as as the GNU allocation
extension, so resulting in "warning: format '%a' expects argument
of type 'float *', but argument 3 has type 'char **'". This
applies to the other %as, %aS and %a[] formats below as well. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
if (sscanf (" 1.25s x", "%as%2c", &sp, c) != 2)
FAIL ();
else
{
if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
FAIL ();
memset (sp, 'x', sizeof "1.25s");
free (sp);
}
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
DIAG_POP_NEEDS_COMMENT;
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
if (sscanf (" 2.25s x", "%las%2c", &d, c) != 2)
FAIL ();
else if (d != 2.25 || memcmp (c, " x", 2) != 0)
FAIL ();
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
/* See explanation above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
if (sscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2)
FAIL ();
else
{
if (wcscmp (lsp, L"3.25") != 0 || memcmp (c, "S x", 3) != 0)
FAIL ();
memset (lsp, 'x', sizeof L"3.25");
free (lsp);
}
if (sscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2)
FAIL ();
else
{
if (strcmp (sp, "4.25") != 0 || memcmp (c, "[0-9.] x", 8) != 0)
FAIL ();
memset (sp, 'x', sizeof "4.25");
free (sp);
}
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
DIAG_POP_NEEDS_COMMENT;
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
if (sscanf ("5.25[0-9.] x", "%la[0-9.]%2c", &d, c) != 2)
FAIL ();
else if (d != 5.25 || memcmp (c, " x", 2) != 0)
FAIL ();
const char *tmpdir = getenv ("TMPDIR");
if (tmpdir == NULL || tmpdir[0] == '\0')
tmpdir = "/tmp";
char fname[strlen (tmpdir) + sizeof "/tst-scanf14.XXXXXX"];
sprintf (fname, "%s/tst-scanf14.XXXXXX", tmpdir);
if (fname == NULL)
FAIL ();
/* Create a temporary file. */
int fd = mkstemp (fname);
if (fd == -1)
FAIL ();
FILE *fp = fdopen (fd, "w+");
if (fp == NULL)
FAIL ();
else
{
if (fputs (" 1.25s x", fp) == EOF)
FAIL ();
if (fseek (fp, 0, SEEK_SET) != 0)
FAIL ();
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
/* See explanation above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
if (fscanf (fp, "%as%2c", &sp, c) != 2)
FAIL ();
else
{
if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
FAIL ();
memset (sp, 'x', sizeof "1.25s");
free (sp);
}
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
DIAG_POP_NEEDS_COMMENT;
if (freopen (fname, "r", stdin) == NULL)
FAIL ();
else
{
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
/* See explanation above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
if (scanf ("%as%2c", &sp, c) != 2)
FAIL ();
else
{
if (strcmp (sp, "1.25s") != 0 || memcmp (c, " x", 2) != 0)
FAIL ();
memset (sp, 'x', sizeof "1.25s");
free (sp);
}
Add macros for diagnostic control, use for scanf %a tests. In <https://sourceware.org/ml/libc-alpha/2014-11/msg00326.html>, Roland requested internal macros for use of "#pragma GCC diagnostic". This patch adds such macros and uses them to disable -Wformat warnings for some code testing GNU scanf %as where GCC expects C99 scanf %a (several other stdio tests currently use -Wno-format to disable warnings). Limitations in GCC's diagnostic pragmas require separate macros before and after the code generating the warnings, rather than a single macro taking that code as an argument. The macros are named DIAG_*_NEEDS_COMMENT to emphasise to reviewers the need for a comment accompanying any use of them (such comments may however just appear once for several uses of the macros for the same issue in the same file). I put a GCC version in the arguments to DIAG_IGNORE_NEEDS_COMMENT, as that seems something useful to grep for when obsoleting support for an old GCC version and needing to decide if warning-disabling code is still relevant. These macros should be usable for replacing existing -Wno-* use in makefiles (as also suggested by Roland), though I have no plans to work on that (only on use of the macros in cases where warnings are currently present that need disabling to use -Werror). Tested for x86_64. * include/libc-internal.h (DIAG_PUSH_NEEDS_COMMENT): New macro. (DIAG_POP_NEEDS_COMMENT): Likewise. (_DIAG_STR1): Likewise. (_DIAG_STR): Likewise. (DIAG_IGNORE_NEEDS_COMMENT): Likewise. * stdio-common/bug21.c: Include <libc-internal.h>. (do_test): Disable -Wformat around call to sscanf. * stdio-common/scanf14.c: Include <libc-internal.h>. (main): Disable -Wformat around some calls to scanf functions.
2014-12-10 01:41:19 +01:00
DIAG_POP_NEEDS_COMMENT;
}
fclose (fp);
}
remove (fname);
* include/stdio.h (__isoc99_fscanf, __isoc99_scanf, __isoc99_sscanf, __isoc99_vscanf): New prototypes. (__isoc99_vsscanf, __isoc99_vfscanf): New prototypes, add libc_hidden_proto. * include/wchar.h (__isoc99_fwscanf, __isoc99_wscanf, __isoc99_swscanf, __isoc99_vwscanf): New prototypes. (__isoc99_vswscanf, __isoc99_vfwscanf): New prototypes, add libc_hidden_proto. * libio/stdio.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/wchar.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __isoc99_* if strict ISO C99 or POSIX conformance requested. * libio/bits/stdio-ldbl.h (fscanf, scanf, sscanf, vfscanf, vscanf, vsscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * wcsmbs/bits/wchar-ldbl.h (fwscanf, wscanf, swscanf, vfwscanf, vwscanf, vswscanf): Redirect to __nldbl___isoc99_* if strict ISO C99 or POSIX conformance requested. * stdio-common/Versions (libc): Export __isoc99_scanf@@GLIBC_2.7, __isoc99_vscanf@@GLIBC_2.7, __isoc99_fscanf@@GLIBC_2.7, __isoc99_vfscanf@@GLIBC_2.7, __isoc99_sscanf@@GLIBC_2.7 and __isoc99_vsscanf@@GLIBC_2.7. * stdio-common/Makefile (routines): Add isoc99_scanf, isoc99_vscanf, isoc99_fscanf, isoc99_vfscanf, isoc99_sscanf and isoc99_vsscanf. (tests): Add scanf14. (CFLAGS-vfprintf.c, CFLAGS-fprintf.c, CFLAGS-printf.c, CFLAGS-vfwprintf.c, CFLAGS-vfscanf.c, CFLAGS-vfwscanf.c, CFLAGS-fscanf.c, CFLAGS-scanf.c, CFLAGS-isoc99_vfscanf.c, CFLAGS-isoc99_vscanf.c, CFLAGS-isoc99_fscanf.c, CFLAGS-isoc99_scanf.c): Add $(exceptions). (CFLAGS-scanf15.c): Add various -I paths to prevent the compiler from using internal headers. * wcsmbs/Versions (libc): Export __isoc99_wscanf@@GLIBC_2.7, __isoc99_vwscanf@@GLIBC_2.7, __isoc99_fwscanf@@GLIBC_2.7, __isoc99_vfwscanf@@GLIBC_2.7, __isoc99_swscanf@@GLIBC_2.7 and __isoc99_vswscanf@@GLIBC_2.7. * wcsmbs/Makefile (routines): Add isoc99_wscanf, isoc99_vwscanf, isoc99_fwscanf, isoc99_vfwscanf, isoc99_swscanf and isoc99_vswscanf. (CFLAGS-isoc99_wscanf.c, CFLAGS-isoc99_fwscanf.c, CFLAGS-isoc99_vwscanf.c, CFLAGS-isoc99_vfwscanf.c): Add $(exceptions). (CPPFLAGS): Add -D_IO_MTSAFE_IO if needed. * stdio-common/isoc99_scanf.c: New file. * stdio-common/isoc99_vsscanf.c: New file. * stdio-common/isoc99_vscanf.c: New file. * stdio-common/isoc99_vfscanf.c: New file. * stdio-common/isoc99_fscanf.c: New file. * stdio-common/isoc99_sscanf.c: New file. * wcsmbs/isoc99_fwscanf.c: New file. * wcsmbs/isoc99_vswscanf.c: New file. * wcsmbs/isoc99_swscanf.c: New file. * wcsmbs/isoc99_wscanf.c: New file. * wcsmbs/isoc99_vwscanf.c: New file. * wcsmbs/isoc99_vfwscanf.c: New file. * libio/libio.h (_IO_FLAGS2_SCANF_STD): Define. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Also clear _IO_FLAGS2_SCANF_STD bit from _flags2. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Don't handle %as, %aS and %a[ if _IO_FLAGS2_SCANF_STD is set in _flags2. * stdio-common/scanf14.c: New test. * stdio-common/scanf15.c: New test. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add isoc99_scanf, isoc99_fscanf, isoc99_sscanf, isoc99_vscanf, isoc99_vfscanf, isoc99_vsscanf, isoc99_wscanf, isoc99_fwscanf, isoc99_swscanf, isoc99_vwscanf, isoc99_vfwscanf and isoc99_vswscanf. * sysdeps/ieee754/ldbl-opt/Versions (libc): Export __nldbl___isoc99_scanf@@GLIBC_2.7, __nldbl___isoc99_fscanf@@GLIBC_2.7, __nldbl___isoc99_sscanf@@GLIBC_2.7, __nldbl___isoc99_vscanf@@GLIBC_2.7, __nldbl___isoc99_vfscanf@@GLIBC_2.7, __nldbl___isoc99_vsscanf@@GLIBC_2.7, __nldbl___isoc99_wscanf@@GLIBC_2.7, __nldbl___isoc99_fwscanf@@GLIBC_2.7, __nldbl___isoc99_swscanf@@GLIBC_2.7, __nldbl___isoc99_vwscanf@@GLIBC_2.7, __nldbl___isoc99_vfwscanf@@GLIBC_2.7 and __nldbl___isoc99_vswscanf@@GLIBC_2.7. * sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__isoc99_scanf, __isoc99_fscanf, __isoc99_sscanf, __isoc99_vscanf, __isoc99_vfscanf, __isoc99_vsscanf, __isoc99_wscanf, __isoc99_fwscanf, __isoc99_swscanf, __isoc99_vwscanf, __isoc99_vfwscanf, __isoc99_vswscanf): Add NLDBL_DECL. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___isoc99_scanf, __nldbl___isoc99_fscanf, __nldbl___isoc99_sscanf, __nldbl___isoc99_vscanf, __nldbl___isoc99_vfscanf, __nldbl___isoc99_vsscanf, __nldbl___isoc99_wscanf, __nldbl___isoc99_fwscanf, __nldbl___isoc99_swscanf, __nldbl___isoc99_vwscanf, __nldbl___isoc99_vfwscanf, __nldbl___isoc99_vswscanf): New functions. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_swscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_wscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_scanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_sscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vsscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vfwscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vswscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_vscanf.c: New file. * sysdeps/ieee754/ldbl-opt/nldbl-isoc99_fscanf.c: New file. * stdio-common/Makefile (tests): Add scanf13. (scanf13-ENV): New. * stdio-common/vfscanf.c (_IO_vfscanf_internal): Handle m modifier followed by l. (STRING_ARG): Add width argument. (_IO_vfscanf_internal) <case L_('c')>: Handle %mc. <case L_('C')>: Handle %mlc and %mC. <case L_('s'), case L_('S'), case L_('[')>: Adjust STRING_ARG arguments. * stdio-common/scanf13.c: New test. * libio/libioP.h (_IO_acquire_lock_clear_flags2_fct): Clear the _IO_FLAGS2_FORTIFY bit from _flags2 rather than _flags. type and __THROW marker of splice, vmsplice, and tee.
2007-09-18 21:04:01 +02:00
return result;
}