C/C++ Programmer's Guide (G06.25+)

C and C++ Extensions
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
2-10
Declarations
Attribute Specifier
The attribute specifier is an HP extension. It is used for writing system-level C and C++
functions and for declaring external routines written in other languages.
The attribute specifier is applicable only in the Guardian environment.
language-specifier
A language-specifier for a function prototype specifies the language of the
body of the external routine being declared.
Considerations for Native Compilers Only
Native C and C++ support mixed-language programs with modules written in
the C, C++, native COBOL, 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 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, the
following language specifiers apply: _c, _cobol, _fortran, _pascal, _tal,
and _unspecified.
If you declare an external procedure as _unspecified, then 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, then in the definition, the name must not contain
lowercase alphabetic characters.
Note. The attribute specifier is an outdated syntax for mixed-language programming and is
maintained only for compatibility. To declare external routines written in another language, you
should use the FUNCTION pragma syntax as described in FUNCTION
on page 13-36.
attribute-specifier:
[ language-specifier ] [ attribute [ attribute ]... ]
language-specifier is one of:
_c | _cobol | _fortran | _pascal | _tal | _unspecified
attribute is one of:
_alias ( "external-name " ) |
_extensible [ ( param-count ) ]
_resident | _variable