HP Fortran Programmer's Guide (B3908-90031; September 2011)

Calling C routines from HP Fortran
Data types
Chapter 8 183
Data types
Table 8-1 lists the corresponding data types for HP Fortran and C when compiled as 32-bit applications.
Using the +DA2.0W option to compile HP Fortran programs in 64-bit mode has no effect on Fortran data
types; see “Compiling in 64-bit mode” on page 94. However, it does change the sizes of some C data types.
If your program calls functions written in C and is compiled in 64-bit mode, you should be aware of the size
discrepancies and either promote individual data items or recompile with the +autodbl option to promote
all default integer, real, and logical items to 64-bits.
Table 8-1 Data type correspondence for HP Fortran and C
HP Fortran C
CHARACTER char (array of)
Hollerith (synonymous with CHARACTER) char (array of)
BYTE, LOGICAL(KIND=1), INTEGER(KIND=1) char
LOGICAL(KIND=2) short
INTEGER(KIND=2) short
LOGICAL, LOGICAL(KIND=4) long or int
INTEGER, INTEGER(KIND=4) long or int
INTEGER(KIND=8) long long
REAL, REAL(KIND=4) float
DOUBLE PRECISION, REAL(KIND=8) double
REAL(KIND=16) long double
COMPLEX, COMPLEX(KIND=4) struct
DOUBLE COMPLEX, COMPLEX(KIND=8) struct
derived type struct