1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-09-11 12:10:50 +03:00

5 Commits

Author SHA1 Message Date
Maciej W. Rozycki
ca0f999a93 stdio-common: Fix NaN input data for scanf input specifier tests [BZ #32857]
Update NaN input data with 'n-char-sequence' in reference data matching
data under test, removing test failures with the M68K host.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-23 01:02:46 +01:00
Maciej W. Rozycki
14957cb1c4 stdio-common: Add 'a', 'g' conversion tests for 0x. scanf input [BZ #12701]
Verify that 0x. input is rejected by 'a' and 'g' conversions (and their
uppercase counterparts).  Replace 0x0p0 input with 0x.0p0 rather than
adding new one, because 0x0 significand is already covered by 0x0p+0
data, so there's no need to keep this duplication.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-11 17:42:12 +01:00
Maciej W. Rozycki
0a8e7ac95c stdio-common: Reject real data w/o exponent digits in scanf [BZ #12701]
Reject invalid formatted scanf real input data the exponent part of
which is comprised of an exponent introducing character, optionally
followed by a sign, and with no actual digits following.  Such data is a
prefix of, but not a matching input sequence and it is required by ISO C
to cause a matching failure.

Currently a matching success is instead incorrectly produced along with
the conversion result according to the input significand read and the
exponent of zero, with the significand and the exponent part wholly
consumed from input.

Correct an invalid `tstscanf.c' test accordingly that expects a matching
success for input data provided in the ISO C standard as an example for
a matching failure.

Enable input data that causes test failures without this fix in place.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28 12:35:53 +00:00
Maciej W. Rozycki
0b390b5508 stdio-common: Reject significand prefixes in scanf [BZ #12701]
Reject invalid formatted scanf real input data that is comprised of a
hexadecimal prefix, optionally preceded by a sign, and with no actual
digits following owing to the field width restriction in effect.  Such
data is a prefix of, but not a matching input sequence and it is
required by ISO C to cause a matching failure.

Currently a matching success is instead incorrectly produced along with
the conversion result of zero, with the prefix wholly consumed from
input.  Where the end of input is marked by the end-of-file condition
rather than the field width restriction in effect a matching failure is
already correctly produced.

Enable input data that causes test failures without this fix in place.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28 12:35:53 +00:00
Maciej W. Rozycki
26df22636d stdio-common: Add scanf float data for IEEE 754 binary32 format
Add Makefile infrastructure and `float' real input data for targets
using the IEEE 754 binary32 format.

Keep input data disabled and referring to BZ #12701 for entries that are
are currently incorrectly accepted as valid data, such as '0e', '0e+',
'0x', '0x8p', '0x0p-', etc.

Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-25 09:40:20 +00:00