[Bug fortran/83704] pr31243 revisited

jb at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 7 10:23:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83704

--- Comment #12 from Janne Blomqvist <jb at gcc dot gnu.org> ---
With these two commits in #c10 and #c11 the testcase now works correctly.
However, if one enables warnings there's still the (spurious) warning:

test1.f90:12:18:

   ch = '123456789'
                  1
Warning: CHARACTER expression will be truncated in assignment (4/9) at (1)
[-Wcharacter-truncation]

If one changes the size of the variable 'ch' to 2_8**31_8+4_8 the warning
message becomes

test2.f90:12:18:

   ch = '123456789'
                  1
Warning: CHARACTER expression will be truncated in assignment (-2147483644/9)
at (1) [-Wcharacter-truncation]

Which looks like a clear case of integer wraparound. Given that the testcase
works, apparently correctly, I would guess the it's an error in the
implementation of the -Wcharacter-truncation warning.


More information about the Gcc-bugs mailing list