[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bugs in printf/sprintf formatted output
From: |
Maciej W. Rozycki |
Subject: |
Re: Bugs in printf/sprintf formatted output |
Date: |
Fri, 5 Jul 2024 17:18:30 +0100 (BST) |
Hi,
On Mon, 24 Jun 2024, Maciej W. Rozycki wrote:
> > First, did you look at test/printf-corners.awk? Did that cover
> > your origial set of issues? If not, what else needs to be
> > included there?
>
> I haven't, I have only run verification against glibc, which already took
> a couple of hours. I'll have a look.
I have looked at test/printf-corners.awk now and it seems to correctly
cover the cases listed, except for those that use "nan" literally as input
and produce zero formatted according to the conversion format supplied.
As I discussed previously this is a questionable case, so maybe it's best
not to handle it at this time.
I have now submitted a patch series separately that extends testing so as
to cover the bignum code paths as well, and also to cover further specific
cases.
I need to correct myself here:
> > > Preexisting issues still unresolved:
> > >
> > > - missing + character in the non-bignum mode only for the input of 0 with
> > > the + flag, precision of 0 and the signed integer conversions, e.g.
> > > { printf "%+.i", 0 } produces "" rather than "+",
> > >
> > > - missing space character in the non-bignum mode only for the input of 0
> > > with the space flag, precision of 0 and the signed integer conversions,
> > > e.g. { printf "% .i", 0 } produces "" rather than " ".
-- these have been partially resolved in that for the field width of 0, as
with { printf "%+.i", 0 } and { printf "% .i", 0 }, output produced is
correctly "+" and " " respectively, however not for the field width of 1,
as with { printf "%+1.i", 0 } (" " produced, "+" expected) or the unsigned
conversions such as { printf "%+.u", 0 } ("+" produced, "" expected) or
{ printf "% .u", 0 } (" " produced, "" expected). This is an oversight of
mine, sorry. These cases have been covered in the patch series submitted.
Maciej
- Re: Bugs in printf/sprintf formatted output,
Maciej W. Rozycki <=