It is unclear to me whether the indicated error about a binding specification being disallowed for internal procedures is correct. Does the Fortran standard really state as such? My quick read of the standard doesn't reveal any such thing and gfortran doesn't think so either.
module m implicit none contains subroutine foo() contains integer function bar() bind(C) bar = 0 end function bar end subroutine foo end module m
Compiling with Intel(R) Visual Fortran Compiler 16.0.1.146 [Intel(R) 64]... m.f90(11): error #8077: A proc-language-binding-spec shall not be specified for an internal procedure.