View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2879 Location: South Pole, Antarctica
|
Posted: Wed Jul 08, 2015 7:19 am Post subject: Confusing diagnostics in module |
|
|
Compile this program which has wrong line marked with the arrow
Code: | 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
Code: | 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. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2879 Location: South Pole, Antarctica
|
Posted: Wed Jul 08, 2015 8:56 am Post subject: |
|
|
The point is different, John. It is about better diagnostics of dumb errors by the compiler |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8061 Location: Salford, UK
|
Posted: Wed Jul 08, 2015 10:55 am Post subject: |
|
|
I have logged this for investigation. |
|
Back to top |
|
|
|