mecej4
Joined: 31 Oct 2006 Posts: 1885
|
Posted: Sat Oct 27, 2018 2:49 pm Post subject: Unreasonable warning message |
|
|
Given the program
Code: | Subroutine Sub(n,nb,g,ag,ind)
implicit none
integer :: n, nb, ind
integer, intent(in) :: g(n), ag(n*n)
!
integer :: i,k, kn
!
ind = 0
l2: Do k = 1, nb - 1
kn = k * n - n
Do i = 1, n
If (g(i) /= ag(kn+i)) Cycle l2
End Do
ind = k
Go To 3
End Do l2
ind = 1
3 nb = nb - 1
print *,'Ind = ',ind
return
End subroutine Sub |
a 32-bit compilation with /opt produces the warning:
Code: | [FTN95/Win32 Ver. 8.30.279 Copyright (c) Silverfrost Ltd 1993-2018]
0001) Subroutine Sub(n,nb,g,ag,ind)
WARNING - This statement will never be executed
NO ERRORS, 1 WARNING [<SUB> FTN95 v8.30.279] |
In this instance it is easy to ignore the warning, but I have seen similar warnings with the statement being named as "will never be executed" being an executable statement (I can provide such an example, but it is much longer than the short example that I gave above). |
|