mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 14:30:06 +00:00
dee2bea048
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.
127 lines
5.3 KiB
Plaintext
127 lines
5.3 KiB
Plaintext
%include <nldbl-abi.h>
|
|
%ifndef NLDBL_VERSION
|
|
% error "nldbl-abi.h must define NLDBL_VERSION"
|
|
%endif
|
|
|
|
libc {
|
|
NLDBL_VERSION {
|
|
# IEEE quad long double functions (older symver is for
|
|
# IEEE double long double).
|
|
ldexpl; copysignl; finitel; frexpl; isinfl; isnanl; modfl;
|
|
__isinfl; __isnanl; __finitel; __signbitl;
|
|
scalbnl;
|
|
qecvt; qfcvt; qgcvt; qecvt_r; qfcvt_r;
|
|
|
|
strtold; __strtold_internal; wcstold; __wcstold_internal;
|
|
__strtold_l; strtold_l; __wcstold_l; wcstold_l;
|
|
|
|
strfmon; __strfmon_l; strfmon_l;
|
|
__nldbl_strfmon; __nldbl___strfmon_l; __nldbl_strfmon_l;
|
|
__nldbl___vstrfmon; __nldbl___vstrfmon_l;
|
|
|
|
syslog; vsyslog;
|
|
__nldbl_syslog; __nldbl_vsyslog;
|
|
__nldbl___syslog_chk; __nldbl___vsyslog_chk;
|
|
|
|
# *printf* family, using IEEE quad long double
|
|
__asprintf; asprintf; dprintf; fprintf; fwprintf; _IO_fprintf;
|
|
_IO_printf; _IO_sprintf; _IO_vfprintf; _IO_vsprintf; obstack_printf;
|
|
obstack_vprintf; printf; __printf_fp; printf_size; snprintf; sprintf;
|
|
swprintf; vasprintf; vdprintf; vfprintf; vfwprintf; vprintf; vsnprintf;
|
|
__vsnprintf; vsprintf; vswprintf; vwprintf; wprintf;
|
|
|
|
# *printf* family, using IEEE double as long double
|
|
# The standard functions are __REDIRECTed to these if -mlong-double-64
|
|
__nldbl___asprintf; __nldbl_asprintf; __nldbl_dprintf; __nldbl_fprintf;
|
|
__nldbl_fwprintf; __nldbl__IO_fprintf; __nldbl__IO_printf;
|
|
__nldbl__IO_sprintf; __nldbl__IO_vfprintf; __nldbl__IO_vsprintf;
|
|
__nldbl_obstack_printf; __nldbl_obstack_vprintf; __nldbl_printf;
|
|
__nldbl___printf_fp; __nldbl_printf_size; __nldbl_snprintf;
|
|
__nldbl_sprintf; __nldbl_swprintf; __nldbl_vasprintf; __nldbl_vdprintf;
|
|
__nldbl_vfprintf; __nldbl_vfwprintf; __nldbl_vprintf; __nldbl_vsnprintf;
|
|
__nldbl___vsnprintf; __nldbl_vsprintf; __nldbl_vswprintf;
|
|
__nldbl_vwprintf; __nldbl_wprintf;
|
|
|
|
# *scanf family, using IEEE quad long double
|
|
_IO_sscanf; _IO_vfscanf; __vfscanf; __vsscanf; fscanf; fwscanf; scanf;
|
|
sscanf; swscanf; vfscanf; vfwscanf; vscanf; vsscanf; vswscanf; vwscanf;
|
|
wscanf;
|
|
|
|
# *scanf family, using IEEE double as long double
|
|
__nldbl__IO_sscanf; __nldbl__IO_vfscanf; __nldbl___vfscanf;
|
|
__nldbl___vsscanf; __nldbl_fscanf; __nldbl_fwscanf; __nldbl_scanf;
|
|
__nldbl_sscanf; __nldbl_swscanf; __nldbl_vfscanf; __nldbl_vfwscanf;
|
|
__nldbl_vscanf; __nldbl_vsscanf; __nldbl_vswscanf; __nldbl_vwscanf;
|
|
__nldbl_wscanf;
|
|
|
|
# checking versions, using IEEE quad long double
|
|
__sprintf_chk; __vsprintf_chk; __snprintf_chk; __vsnprintf_chk;
|
|
__printf_chk; __fprintf_chk; __vprintf_chk; __vfprintf_chk;
|
|
|
|
# checking versions, using IEEE double as long double
|
|
__nldbl___sprintf_chk; __nldbl___vsprintf_chk; __nldbl___snprintf_chk;
|
|
__nldbl___vsnprintf_chk; __nldbl___printf_chk; __nldbl___fprintf_chk;
|
|
__nldbl___vprintf_chk; __nldbl___vfprintf_chk;
|
|
__nldbl___swprintf_chk; __nldbl___vswprintf_chk; __nldbl___fwprintf_chk;
|
|
__nldbl___wprintf_chk; __nldbl___vfwprintf_chk; __nldbl___vwprintf_chk;
|
|
}
|
|
GLIBC_2.7 {
|
|
__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;
|
|
}
|
|
GLIBC_2.8 {
|
|
__nldbl___asprintf_chk; __nldbl___vasprintf_chk;
|
|
__nldbl___dprintf_chk; __nldbl___vdprintf_chk;
|
|
__nldbl___obstack_printf_chk; __nldbl___obstack_vprintf_chk;
|
|
}
|
|
GLIBC_2.30 {
|
|
__nldbl_argp_error; __nldbl_argp_failure;
|
|
__nldbl_warn; __nldbl_vwarn; __nldbl_warnx; __nldbl_vwarnx;
|
|
__nldbl_err; __nldbl_verr; __nldbl_errx; __nldbl_verrx;
|
|
__nldbl_error; __nldbl_error_at_line;
|
|
}
|
|
GLIBC_2.38 {
|
|
__nldbl___isoc23_scanf;
|
|
__nldbl___isoc23_fscanf;
|
|
__nldbl___isoc23_sscanf;
|
|
__nldbl___isoc23_vscanf;
|
|
__nldbl___isoc23_vfscanf;
|
|
__nldbl___isoc23_vsscanf;
|
|
__nldbl___isoc23_wscanf;
|
|
__nldbl___isoc23_fwscanf;
|
|
__nldbl___isoc23_swscanf;
|
|
__nldbl___isoc23_vwscanf;
|
|
__nldbl___isoc23_vfwscanf;
|
|
__nldbl___isoc23_vswscanf;
|
|
}
|
|
}
|
|
libm {
|
|
NLDBL_VERSION {
|
|
# IEEE quad long double functions (older symver is for
|
|
# IEEE double as long double).
|
|
cabsl; cargl; cimagl; conjl; creall; cacosl; cacoshl; casinl;
|
|
catanl; catanhl; ccosl; ccoshl; casinhl; cexpl; clogl; __clog10l;
|
|
clog10l; cpowl; cprojl; csinl; csinhl; csqrtl; ctanl; ctanhl;
|
|
fdiml; fmal; fmaxl; fminl; ldexpl; nanl; nextafterl; nexttowardl;
|
|
significandl; acosl; acoshl; asinl; atan2l; atanhl; coshl; dreml;
|
|
exp10l; pow10l; exp2l; fmodl; hypotl; j0l; y0l; j1l; y1l; jnl; ynl;
|
|
lgammal; gammal; lgammal_r; logl; log10l; log2l; powl; remainderl;
|
|
scalbl; sinhl; sqrtl; tgammal; asinhl; atanl; cbrtl; ceill; copysignl;
|
|
erfl; erfcl; expm1l; fabsl; finitel; floorl; frexpl; ilogbl;
|
|
llrintl; llroundl; log1pl; logbl; lrintl; lroundl; modfl;
|
|
nearbyintl; remquol; rintl; roundl; scalblnl; scalbnl; sinl; cosl;
|
|
sincosl; tanl; tanhl; truncl; expl; __finitel; __signbitl;
|
|
__fpclassifyl; nexttowardf; nexttoward; __nldbl_nexttowardf;
|
|
}
|
|
GLIBC_2.28 {
|
|
# Functions taking long double = double argument and rounding
|
|
# result to double (same as f32x*f64 functions, but those names
|
|
# are not reserved in TS 18661-1).
|
|
__nldbl_daddl; __nldbl_ddivl; __nldbl_dmull; __nldbl_dsubl;
|
|
}
|
|
}
|