Silverfrost Forums

Welcome to our forums

Unreasonable warning message

27 Oct 2018 1:49 #22711

Given the program

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:

[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).

27 Oct 2018 3:19 #22712

Yes. There are a number of situations where this false warning is given particularly with the new 64 bits. This is a known issue but I will make a note of this particular case.

8 Nov 2018 4:43 #22770

I have not been able to reproduce this issue when using the latest internal version of FTN95 so hopefully it has already been fixed in a different context.

Please login to reply.