Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Is a mismatch in proc_language_binding_spec (e.g., bind(C)) between procedure pointer object and the target allowed?

$
0
0

Is the following simple code snippet standard-conforming?  The code compiles with no errors or warnings with the latest Intel Fortran 16.0 compiler, update 1.  Note the missing proc_language_binding_spec of bind(C) on the procedure target which, to me, appears like a difference in characteristics of the object and the target.  Is this something a coder can expect from the compiler to get flagged as an error?

Thanks,

module m

   implicit none

   abstract interface

      subroutine Ifoo() bind(C)

      end subroutine Ifoo

   end interface

   procedure(Ifoo), pointer :: foo => subfoo

contains

   subroutine subfoo()  !.. Note the missing proc_language_binding_spec of bind(C)

   end subroutine subfoo

end module m

Listed below is an extract from Fortran 2008 standard document (WD 1539-1 J3/10-007r1 dated 2010-11-24): 

7.2.2.4 Procedure pointer assignment
..
3 If the pointer object has an explicit interface, its characteristics shall
  be the same as the pointer target except that the pointer target may be
  pure even if the pointer object is not pure and the pointer target may be an
  elemental intrinsic procedure even if the pointer object is not elemental. 

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>