C/C++ Programmer's Guide (G06.25+)
Mixed-Language Programming for TNS Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
7-8
Matching Data Types
Matching Data Types
Use data types that are compatible between languages for:
•
Shared global variables
•
Formal or actual parameters
•
Function return values
Table 7-2 lists compatible TAL and C data types for each TAL addressing mode.
Incompatibilities between TAL and TNS C data types include the following:
•
TAL has no numeric data type that is compatible with C unsigned long type.
•
TAL UNSIGNED is not compatible with C unsigned short type. TAL
UNSIGNED(16) can represent signed or unsigned values.
For more information on TNS C and TAL data types, see Variables and Parameters on
page 7-17.
Table 7-2. Compatible TAL and TNS C Data Types
TAL Addressing Mode TAL Data Type C Data Type Notes
Direct STRING char
Direct INT short TAL INT signed range
only
Direct INT(32) long
Direct FIXED(0) long long TAL FIXED(0) only
Direct REAL float
Direct REAL(64) double
Standard indirect (.) STRING char
*
Standard indirect (.) INT short
*
Standard indirect (.) INT(32) long
*
Standard indirect (.) FIXED(0) long long
*
Standard indirect (.) REAL float
*
Standard indirect (.) REAL(64) double
*
Extended indirect (.EXT) STRING char _far
*
For _far, see Note.
Extended indirect (.EXT) INT short _far
*
Extended indirect (.EXT) INT(32) long _far
*
Extended indirect (.EXT) FIXED(0) long long
_far
*
Extended indirect (.EXT) REAL float _far
*
Extended indirect (.EXT) REAL(64) double _far
*
Note: In C, use _far only in the parameter-type list of an interface declaration to specify a parameter
type that is defined in TAL as an extended pointer.