Oracle® Solaris Studio 12.4: Fortran User's Guide

Exit Print View

Updated: March 2015
 
 

4.6.1 Interoperability with C

The new standard for Fortran provides:

  • a means of referencing C language procedures and, conversely, a means of specifying that a Fortran subprogram can be referenced from a C function, and

  • a means of declaring global variables that are linked with external C variables

The ISO_C_BINDING module provides access to named constants that are kind type parameters representing data that is compatible with C types.

The standard also introduces the BIND(C) attribute. A Fortran derived type is interoperable with C if it has the BIND attribute.

The Fortran compiler implements the features described in Chapter 15 of the Fortran standard. All intrinsic functions defined in Chapter 15 have been implemented. Fortran also provides facilities for defining derived types and enumerations that correspond to C types, as described in Chapter 4 of the standard.