I think it is formally valid to have multiple times the same C binding label
(at least for procedures). At least I cannot find anything in the standard
which says otherwise.

Currently, both gfortran and NAG f95 reject the following program while g95 and
ifort accept it.

See also question posted at:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/b1e8c8d0af9d16e8/
(when writing this, the question was not yet answered)

NAG f95:
Error: aaa.f90: Duplicate binding label 'xxx' for external procedure XXX_1 and
external procedure XXX_2

gfortran:
Error: Binding label 'xxx' in interface body at (1) collides with the global
entity 'xxx' at (2)

interface xxx
    integer function xxx_1( y ) bind( c, name = "xxx" )
        use iso_c_binding
        real(c_float), intent(inout) :: y
    end function
    integer function xxx_2( y ) bind( c, name = "xxx" )
        use iso_c_binding
        real(c_float), intent(inout), dimension(*) :: y
    end function
end interface
end


-- 
           Summary: Bind(C): Procedures with different interface and same C
                    binding label
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35161

Reply via email to