Hi Paul!
Here is another problem with the detection of INTEGER overflows. I have tested v4.91 and proofed that the program did not catch the overflow. CVF 6.6 and IVF 9.0 don't detect it too.
Kind regards,
Joerg QT software
Winapp Program Test_OutofRange
Implicit None
Integer , Parameter :: iKind = selected_int_kind (2)
Integer (iKind) :: k
write (,) ' Results of Program Test_OutofRange' write (,) ' ==================================' write (,)
write (,) ' Kind of k = ', iKind write (,) ' Huge (k) = ', Huge (k) write (,) write (,) ' Kind of 9999 = ', kind (9999) write (,) ' Huge of 9999 = ', Huge (9999) write (,) write (,)
! Clearly, k = 9999 is out of range, i.e. gt 127. ! A program stop should occur. ! Instead a wrong value (k=15) is given for the variable k; please see the output.
k = 9999
! k = 9999_iKind gives an error message during compilation
write (,) 'The assignment statement k = 9999 gives k = ', k write (,) 'without any warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
End Program Test_OutofRange