This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with zeros.


On Thu, Jul 19, 2007 at 05:56:23PM -0700, Jerry DeLisle wrote:
> >>
> >>
> >>  if (errno != 0 && errno != EINVAL)
> >>    {
> >>      generate_error (&dtp->common, ERROR_READ_VALUE,
> >>                      "Range error during floating point read");
> >>      return 1;
> >>    }
> >>

(snipped a bunch of stuff)

In looking at the above again, the conditional doesn't
make any sense to me.  If it really was meant to check
for ERANGE, then it should have been errno == ERANGE.

> Index: read.c
> ===================================================================
> --- read.c      (revision 126739)
> +++ read.c      (working copy)
> @@ -177,10 +177,10 @@ convert_real (st_parameter_dt *dtp, void
>        internal_error (&dtp->common, "Unsupported real kind during IO");
>      }
> 
> -  if (errno != 0 && errno != EINVAL)
> +  if (errno == EINVAL)
>      {
>        generate_error (&dtp->common, ERROR_READ_VALUE,
> -                     "Range error during floating point read");
> +                     "Error during floating point read");
>        return 1;
>      }
> 
> Which gives this result on my system (x86-64-pc-Gnu/Linux):
> 
> [jerry@quasar test]$ ./a.out
>    0.000000       0.000000       0.000000       0.000000
> 
> Concur Steve?

I'm fine with this patch or removing the entire test.
The middle and back end will hopefully properly fold
constants to 0 or +-Inf.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]