(j3.2006) Interesting F2003-ism
Aleksandar Donev
donev1
Thu Feb 22 11:09:48 EST 2007
Andy Vaught wrote:
> That's a dumb restriction.
It is not a restriction, it is a definition of what is sure to be
interoperable. It does not exclude other things from also being
interoperable, in the sense that g95 is free to implement Interop for
procs with variable-argument lists. We simply do not standardize it
since it has no Fortran equivalent. And it may be that such procedures
require a different calling sequence than simply assuming a fixed number
of arguments (as you do for printf). So IMO your example should remain
outside the standard. As Malcolm said, it is outside C too...ellipses
are to remain ellipses even in C.
> I will start the process by not
> implementing the restriction on binding-labels in g95...
Good, since that restriction makes perfectly sensible programs illegal
too, most notably my favorite example:
module A
interface
subroutine p_A(f, a) bind(c, name='p')
type(c_ptr) :: f
integer, value :: a
end subroutine p1
end module
module B
interface
subroutine p_B(f, a) bind(c, name='p')
type(c_ptr) :: f
integer, value :: a
end subroutine p1
end module
Note that here one is merely giving two different Fortran names in two
*distinct* modules to the same interface and same C procedure.
Aleks
More information about the J3
mailing list