View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Sun Mar 03, 2013 1:21 pm Post subject: Procedure arguments with /CHECK |
|
|
The following code gives an incorrect error message when compiled and run with /CHECK
Code: | MODULE m1
CONTAINS
FUNCTION f()
INTEGER :: f
f=0
END FUNCTION f
END MODULE m1
MODULE m2
CONTAINS
SUBROUTINE s (g)
INTEGER, EXTERNAL :: g
PRINT *, g()
END SUBROUTINE s
END MODULE m2
WINAPP
PROGRAM p
USE m1
CALL s (f)
END PROGRAM p
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Apr 09, 2013 3:54 pm Post subject: |
|
|
I have logged this for investigation. |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Apr 09, 2013 5:27 pm Post subject: |
|
|
But s is in m2 and isn't in m1.
Therefore s is being treated as an EXTERNAL subroutine and you should get a run time errror _s not found with that code.
I think the code simon should have posted is this (I have added a missing USE statement). This generates the run-time error with /CHECK .
Code: |
MODULE m1
CONTAINS
FUNCTION f()
INTEGER :: f
f=0
END FUNCTION f
END MODULE m1
MODULE m2
CONTAINS
SUBROUTINE s (g)
INTEGER, EXTERNAL :: g
PRINT *, g()
END SUBROUTINE s
END MODULE m2
WINAPP
PROGRAM p
USE m1
USE m2
CALL s (f)
END PROGRAM p
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Mar 12, 2014 8:26 pm Post subject: |
|
|
This bug has now been fixed for the next release. |
|
Back to top |
|
 |
|