Re: Integers and standard



Steven G. Kargl wrote:
...
Note, it does not use signed-int-literal-constant. More importantly
Z'80000000' will be converted to either an INTEGER(8) or INTEGER(16)
(depends on the hardware and I'm using gfortran's kind type parameter
values) value prior to the assignment.

j.f90:2.24:

data i/Z'80000000'/
1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1)

I don't have gfortran installed, so I can't test it, but what does
it do if you overflow an integer expression at run-time? If
it doesn't abort then, why does it cause fatal error at compile-
time? The standard doesn't say what implementations should
do with overflow, but whatever it is should be consistent as
a quality of implementation issue.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare

"Simplicity is prerequisite for reliability" -- E. W. Dijkstra


.