BIND (Fortran 2003)

Purpose

The BIND attribute declares that a Fortran variable or common block is interoperable with the C programming language.

Syntax

Read syntax diagramSkip visual syntax diagram
                                                           .-,---------------------.   
                                                           V                       |   
>>-BIND--(--C--+-----------------------------+--)--+----+----+-variable_name-----+-+-><
               '-, -NAME-- = --binding_label-'     '-::-'    '-common_block_name-'     

binding_label
is a scalar character constant expression

Rules

This attribute specifies that a Fortran variable or common block is interoperable with a C entity with external linkage. Refer to Interoperability of variables and Interoperability of common blocks for details.

If the NAME= specifier appears in a BIND statement, then only one variable_name or common_block_name can appear.

If a BIND statement specifies a common block, then each variable of that common block must be of interoperable type and type parameters, and must not have the POINTER or ALLOCATABLE attribute.

Table 1. Attributes compatible with the BIND attribute
ASYNCHRONOUS SAVE
DIMENSION STATIC  2 
PRIVATE TARGET
PROTECTED  1  VOLATILE
PUBLIC  
Note:
  •  1  Fortran 2003
  •  2  IBM extension

Related information