[PATCH 12/15] stdio-common: Fix NaN input data for scanf input specifier tests [BZ #32857]
Maciej W. Rozycki
macro@redhat.com
Tue May 6 15:15:11 GMT 2025
On Tue, 6 May 2025, Andreas Schwab wrote:
> > -%la:-nan(09A_Zaz):1:13:-nan:
> > +%la:-nan(09A_Zaz):1:13:-nan(09A_Zaz):
>
> Since 09A_Zaz is not a valid number, this is actually read as the
> default NaN, not as a NaN with a payload, and should be verified as
> such.
It's an implementation detail we don't need or indeed want to rely on.
The `n-char-sequence' token does not have to be a number and neither ISO
C nor POSIX say how to interpret non-numeric or indeed any values. All
the tests are meant to verify or rely on is that a given `n-char-sequence'
value is interpreted the same way when handed as input to `scanf', etc. as
it would when passed as an argument to `nan', etc.
So I maintain it is correct test input given here. If you'd like various
`n-char-sequence' values verified for specific payload patterns produced,
then it will have to be a separate test case.
Maciej
More information about the Libc-alpha
mailing list