[Bug fortran/38504] double minus sign when printing integer?
kloedej at knmi dot nl
gcc-bugzilla@gcc.gnu.org
Fri Dec 12 14:48:00 GMT 2008
------- Comment #2 from kloedej at knmi dot nl 2008-12-12 14:47 -------
(In reply to comment #1)
> Sort of confirmed. You are aware that 'value-1' corresponds to
> '-HUGE(value)-1', which is out of range for integer numbers of that kind?
Thanks for your reply.
Yes I am aware that defining an integer constant with value '-HUGE(value)-1' is
not allowed, but as far as I know the variable type is allowed to contain that
value.
So if:
value = -9223372036854775807_i8_ -1
is illegal, then something like:
value = -9223372036854775807_i8_
value = value-1
should be legal, and still be within the range of an 8 byte integer.
See also this discussion:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29580
Anyway, the point is that gfortran does accept this code, but if you write to a
character variable the result is strange.
Best regards,
Jos de Kloe
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38504
More information about the Gcc-bugs
mailing list