(j3.2006) calling a Fortran subroutine with BIND attribute--standard conforming or no?
Michael Ingrassia
michaeli
Fri Jan 18 14:35:06 EST 2008
I'm having trouble finding some language I expected to be in Fortran 2003.
Consider the program:
subroutine s() bind(c,name='t')
end subroutine s
call s()
end
I think that this program is not standard conforming. Oh, it will run ok
on a processor that routinely translates subroutines named s into
routines with linker name t, but I doubt such processors exist!
Mostly I expect it will try to call a routine with linker name derived from "s"
(say, s_) and fail because user has supplied only a subroutine with linker
name t.
But I can't find any language in the standard that says this program
isn't standard conforming. We seem to be defining a Fortran subroutine named
s with some extra attributes , and then calling that subroutine.
The extra attribute is the name by which the subroutine is known to the
companion processor, which is utterly irrelevant in this all-Fortran run.
Am I right that the name of the subroutine defined in lines 1-2 is "s" ?
Doesn't C1223 say that the procedure-designator in the CALL statement
shall be the name of the procedure, not the binding label ?
Where is there language saying that if we call a subroutine with an
unexpected binding label, an interface supplying the binding label
must be in force?
--Michael I.
More information about the J3
mailing list