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:
(when writing this, the question was not yet answered)
Error: aaa.f90: Duplicate binding label 'xxx' for external procedure XXX_1 and external procedure XXX_2
Error: Binding label 'xxx' in interface body at (1) collides with the global entity 'xxx' at (2)
integer function xxx_1( y ) bind( c, name = "xxx" )
real(c_float), intent(inout) :: y
integer function xxx_2( y ) bind( c, name = "xxx" )
real(c_float), intent(inout), dimension(*) :: y
*** Bug 35172 has been marked as a duplicate of this bug. ***
(In reply to comment #0)
> See also question posted at:
> (when writing this, the question was not yet answered)
Conclusion at c.l.f:
"the standard does not require the compiler to issue a message
about names associated to BIND(C,name=...). However I like to see
gfortran reporting that two C names coincide."
See also: PR38386.
*** Bug 41704 has been marked as a duplicate of this bug. ***
*** Bug 38386 has been marked as a duplicate of this bug. ***
Adjusted summary to match information given in dupes.
Mark as duplicate of PR 48858 - which has in PR 48858 comment 9 a better description why it is valid in F2008 - and links to an IR which confirms the invalidity in F2003.
*** This bug has been marked as a duplicate of bug 48858 ***