This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Internal procedure not allowed as actual argument
- From: "Janus Weil" <jaydub66 at googlemail dot com>
- To: "Fortran List" <fortran at gcc dot gnu dot org>
- Date: Sat, 30 Jun 2007 20:48:27 +0200
- Subject: Internal procedure not allowed as actual argument
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=n1IS4xSphGIKoguNU1KQd9IBNq1lwBwiD2n/fCIk1brE1VHPYZx3Bfruwwko8E9hRl9y+c8Ols1oL0s8WykLtNh6aNdkhjJO3O7pystPCAgAgig5tdCUuz75Q2ic6tRR4dxuuO1Ku6Mz9FqV6EcamRuXtWDWOZOkkco+QhndhE0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NnxG+jp5fRgwV/ZQJrUZjWXYuLY0IEM3mFyzdGPJLfvhpmctpkqlDnBdzgtKbADX01NNGSlmbyFTV3ieG5P267y5CnCuDb1Y2d5sew6WTDEfhfvclRy3AwjdPVbV8+vQJ/BAMj508bSyHrc1WSNteb0qEkFDcK75zEw28X3jsEw=
Hi all,
I have a question: why doesn't gfortran allow passing an internal
procedure as an argument to another procedure, as in this example:
subroutine sub
call proc(f1)
call proc(f2)
contains
real function f1(x)
...
end function f1
end subroutine sub
real function f2(x)
...
end function f2
If we have a subroutine "proc" that expects an external function as
its argument, "call proc(f2)" is allowed by gfortran, while "call
proc(f1)" triggers an error like this:
Error: Internal procedure 'f1' is not allowed as an actual argument at (1)
g95 shows the same behaviour, but ifort doesn't complain about this at all.
Can anyone tell me what the reason for this restriction is?
Thanks,
Janus