C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
language-specifier is one of:
_c | _cobol | _fortran | _pascal | _tal | _unspecified
attribute is one of:
_alias ( "external-name " ) |
_extensible [ ( param-count ) ]
_resident | _variable
language-specifier
A language-specifier for a function prototype specifies the language of the body of the
external routine being declared.
Considerations for the Native Compilers Only
• Native C and C++ support mixed-language programs with modules written in the C, C++,
native COBOL85, and native pTAL languages. Therefore, the only language specifiers that
apply are _c, _cobol, _tal, and _unspecified. Use _tal to denote the pTAL language
on both TNS/E and TNS/R systems.
Considerations for the TNS Compilers Only
• TNS C and C++ support mixed-language programs with modules written in C, C++, TNS
COBOL, FORTRAN, D-series Pascal, and TAL. Therefore, these language specifiers apply:
_c, _cobol, _fortran, _pascal, _tal, and _unspecified.
• If you declare an external procedure as _unspecified, the actual procedure cannot be
both written in C and compiled using the OLDCALLS pragma.
• If you declare an external procedure as _unspecified and that procedure is actually written
in C, in the definition, the name must not contain lowercase alphabetic characters.
Considerations for Both the Native and TNS Compilers
• Only one language specifier can be specified for a function.
• The language specifier is allowed only in function declarations, function definitions, and
function pointer declarations. However, _cobol, _fortran, _pascal, _tal, and
_unspecified are not allowed in function definitions. _c is allowed in a function definition
only if the language being compiled is C.
• For C++, a language specifier is not allowed on overloaded functions, member functions,
function templates, inline functions, or functions with default arguments.
• For a function with C-style variable argument lists, the only explicit language attribute allowed
is _c.
• The language specifier _unspecified indicates that the language is unknown and
unspecified.
attribute
specifies a function attribute.
Considerations for Both the Native and TNS Compilers
• An attribute is allowed only in function declarations, function definitions, and function
pointer declarations.
• The same attribute is not allowed to appear more than once in a function declaration.
• In C++, attributes on virtual functions are not inherited.
• A function is allowed to have multiple declarations. If the multiple declarations are incompatible,
an error message is generated. If the declarations are compatible, the attribute values are
56 C and C++ Extensions