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

What hath "TS 29113/TS 18508" wrought!?

$
0
0

The following simple code compiles fine with the latest Intel Fortran compiler 2015, update 2 but it gives an error with gfortran, a GCC 5.0 development trunk version.

The error, as shown below, has to do with "TS 29113/TS 18508", presumably related to further interoperability features with C in the next standard.   Now I am not sure if Intel has started implementing any of these features yet, so Intel Fortran compiler behavior may not be relevant yet.

However, looking at TS 29113, I don't see anything that states this code is in error; the code is so basic, if this is not allowed, then I wonder what is!  My take on this is gfortran has a bug; I would appreciate any comments and feedback on this.

module m

   use, intrinsic :: iso_c_binding, only : c_funptr, c_f_procpointer

   implicit none

   private

   abstract interface

      subroutine ifoo()
      end subroutine ifoo

   end interface

   type(c_funptr)           :: c_f_ptr
   procedure(ifoo), pointer :: f_f_ptr

contains

   subroutine set_fptr()

      call c_f_procpointer(c_f_ptr, f_f_ptr)

   end subroutine set_fptr

end module m

 

Compilation error with options -Wall -std=f2008 in gfortran :

m.f90:23.36:
      call c_f_procpointer(c_f_ptr, f_f_ptr)
                                    1
Error: TS 29113/TS 18508: Noninteroperable procedure pointer at (1) to C_F_PROCPOINTER

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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