On Sun, Mar 23, 2025 at 02:44:29PM -0500, Robert Dubner wrote:
> I am enclosing a patch to be applied on top of yours.  (Your patch got us
> down to zero errors in the "Coughlan" tests, 2 UAT errors, and 4 errors in
> the NIST tests.  Well done!)
> 
> This one passes all of my tests, in both ASCII and EBCDIC forms.  It also
> passes "make check-cobol".  That's on my x_86_64-linux machine.
> 
> (That's the good news.  The bad news is that this is exposing gaps in
> coverage of our test suites.  There is stuff that the misnamed numstr2i
> routine used to do that isn't being done, but no errors are flagged in any
> test.)
> 
> Given that this version passes everything that our regression tests cover,
> is it time to accumulate all this work into a single patch and have that
> committed?
> 
> Perhaps I should create that patch, seeing as how at this moment only I
> can do all of my known tests.

Note, at least on my side, I haven't yet groked the formatting rules in the
COBOL FE, so feel free to reindent/reformat it in the style you're used to.

> diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
> index ca86ffa2fc74..f3cab0a4ad1e 100644
> --- a/gcc/cobol/genapi.cc
> +++ b/gcc/cobol/genapi.cc
> @@ -4897,8 +4897,7 @@ parser_display_internal(tree file_descriptor,
>        }
>      else
>        {
> -      p += 1;
> -      int exp = atoi(p);
> +      int exp = atoi(p+1);
>        if( exp >= 6 || exp <= -5 )
>       {
>       // We are going to stick with the E notation, so ach has our
> result

Oops, yes, without it all the e -> E and exponent rewriting is wrong.
I wrote that part without actually testing it on anything.

        Jakub

Reply via email to