Silverfrost Forums

Welcome to our forums

Confusing diagnostics in module

8 Jul 2015 6:19 #16558

Compile this program which has wrong line marked with the arrow

module Mo

CONTAINS

integer function f()
f=1
end function

subroutine abracadabra ! <--- wrong line

end module
!--------------------------
Program Pro
  use Mo
  Print*,' Nothing to print'
End program

The diagnostics is pretty confusing in this case because points at the wrong line as if something wrong is with integer function F or this function does not have END statement

    PROCESSING MODULE  [<MO> FTN95/Win32 v7.10.0]
0004) integer function f()
*** INTEGER cannot be declared inside SUBROUTINE block (perhaps missing 
    CONTAINS or END statement?)

If you change this wrong line with something else like CALL abracadabra

or

abracadabra

the diagnostics is correct and points at the exact offending place.

8 Jul 2015 7:56 #16559

The point is different, John. It is about better diagnostics of dumb errors by the compiler

8 Jul 2015 9:55 #16561

I have logged this for investigation.

Please login to reply.