GCC Bugzilla – Bug 35031
ELEMENTAL procedure with BIND(C)
Last modified: 2010-05-09 13:34:04 UTC
ELEMENTAL conflicts with BIND(C).
However, the following is not rejected (diagnosed) by gfortran:
elemental subroutine sub(x)
integer, intent(in) :: x
entry sub_c(x) bind(c)
end subroutine sub
Actually, this is a loop hole in the Fortran 2003 standard, which will be presumably fixed by an erratum. (It passed the J3 ballot, WG3 and ISO approval are still needed.) See F03/0086:
No, it is not allowed. Constraint C1242 was intended to disallow
the combination of elemental and BIND(C), but it inadvertently
failed to cover the case shown in the above example.
Replace C1242 in subclause 188.8.131.52 with
"C1242 An ELEMENTAL procedure shall not have the BIND attribute.".
Draft 2003 corrigendum 3: ftp://ftp.nag.co.uk/sc22wg5/N1701-N1750/N1727.pdf
(Not yet sent to ISO and thus also not ISO approved.)
(In reply to comment #1)
> Draft 2003 corrigendum 3: ftp://ftp.nag.co.uk/sc22wg5/N1701-N1750/N1727.pdf
> (Not yet sent to ISO and thus also not ISO approved.)