This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40461] Interface mismatch in dummy procedure
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2009 17:36:16 -0000
- Subject: [Bug fortran/40461] Interface mismatch in dummy procedure
- References: <bug-40461-14284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2009-06-16 17:36 -------
I think the error is a valid error. For comparison, NAG f95 5.1 shows the
following error message:
Error: line 19: Dummy proc DERIV arg 1 has different INTENT from actual proc
LOGISTIC4 arg
Error: line 19: Incompatible procedure argument for DERIV (no. 1) of HALPRN
* * *
Independent from what the standard says, I think the error message makes sense:
If one calls in "SUBROUTINE halprn" the dummy "subroutine deriv" as, e.g.,
call deriv(5)
that is perfectly correct. But the actual argument is "Logistic4" and as its
first argument is INTENT(OUT), the argument needs to be definable, which "5"
clearly isn't.
I think there is no other solution than to fix it. A work around is to use no
INTENT at either place, but I think arithmetically either INTENT(IN) or
INTENT(OUT) is correct (or INTENT(INOUT)) but having once IN and once OUT is
really bug in your program.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40461