bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk number to string bug


From: Aharon Robbins
Subject: Re: gawk number to string bug
Date: Sat, 24 Dec 2005 21:58:58 +0200

On Sat, Dec 24, 2005 at 09:22:16AM +0200, Eli Zaretskii wrote:
> This thread produced many ideas and quite a few patches
> (some of the patches made me shiver with horror in sight of the
> monstrosity of a solution offered for such a simple problem), but IMHO
> it failed to produce 2 things: (1) the Gawk maintainer's agreement to
> all those ideas and patches,

The gawk maintainter hasn't had time to do much more than skim the
patches and discussion as things have gone flying by.  That said, after
posting my first patch I made further changes in my code that used %.0f
for formatting integral values but didn't post the changes, figuring that
the issue was closed... Clearly that wasn't right. :-)

Of the patches that have been suggested, I am most likely to take
Andrew's, or at least use it as a starting point.

> and (2) references to some standard, such
> as Posix, as to what should Gawk do in these situations.  To me, these
> deficiencies makes this whole discussion a bit pointless.

The problem is that standards interpretation also requires time; the
relevant parts are scattered around various parts of the standards document
and reading just the awk part isn't always enough.  At least my background
in Talmud study comes in handy for that part of the job! :-)

> Date: Sat, 24 Dec 2005 13:52:09 -0500
> From: "Andrew J. Schorr" <address@hidden>
> Subject: Re: gawk number to string bug
> To: Eli Zaretskii <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden,
>         address@hidden, address@hidden
>
> I agree that these patches are all a work in progress, intended
> to stimulate discussion, and hopefully lead to an agreement on the best
> approach to take.
>
> That being said, I did discover a real buffer overflow bug that should
> be fixed, I think.  Or do you propose leaving the buggy code as is?

The %.40d bug is indeed a problem that needs solving, no matter what.

In terms of negative zero, I get slightly different results from other
awks, but I'm inclined that it should print as positive zero. Those who
shudder in horror about lack of precision, etc. etc should simply find
another language in which to do their high precision work...

The rounding issue needs to be solved.  Andrew, does your latest patch
fix that?  If not, can you resend a patch that handles it as well for
me to evaluate?

In the meantime, I will see if I can't extract some useful guidance
from the various bits of the POSIX standard.

Let me state explicitly that I appreciate everyone's efforts!  I wish I
had more time to be more responsive; the lack of response is due only
to lack of time, not lack of interest.

Thanks,

Arnold




reply via email to

[Prev in Thread] Current Thread [Next in Thread]