Missing warning
Steve Kargl
sgk@troutmask.apl.washington.edu
Thu Feb 28 21:08:00 GMT 2019
On Thu, Feb 28, 2019 at 12:32:31PM -0800, Steve Kargl wrote:
> >
> > It seems that the exponential operator is not range checking
> > its result during constant folding. The RHS side for the
> > assignment of 'i' is too large for the decimal range for
> > a signed 32-bit integer. The RHS of the assignment of 'x'
> > accidentally gets the intended number.
> >
> > F2018, 10.1.5.2.4 Evaluation of numeric intrinsic operations
> >
> > The execution of any numeric operation whose result is not defined
> > by the arithmetic used by the processor is prohibited.
> >
> > One might argument that the result for 'i' is valid Fortran
> > as 2s-complement wrap semantics may be "the arithmetic used
> > by the processor". If that is the case, then the result for
> > 'x' is wrong. OTOH, the infinite precision result for 10**23
> > shown in the dump as 10000000000000000000000 is outside of the
> > range of a signed 32-bit integer. I suspect that gfortran should
> > be issuing a warning here.
>
> LOL. It seems that I'm the guilty party for not issuing a
> warning or error. See r145261 for details. I have
> no idea what I was thinking 9 years ago.
>
Comically, there is another bandage that prevent an
error message from occurring. See r258416.
--
Steve
More information about the Fortran
mailing list