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

C and C++ Extensions
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
2-12
Declarations
Table 2-2, Effects of Function Attributes, shows the effect of function attributes for
each language. “Valid” indicates that the compiler accepts the attribute. “Ignore”
indicates that the compiler accepts but ignores the attribute. “Error” indicates that
the compiler issues an error.
An attribute can be one of the following:
_alias ("external-name")
identifies the name of the external routine being declared and is used for
mixed-language programming. _alias is used at bind-time for TNS C and
C++ programs or at link-time for native C and C++ programs. The external-
name argument must be enclosed in parentheses and quotation marks, as
indicated in the syntax. For example:
_alias ("MY^PROC")
Use _alias to describe the name of an external routine written in COBOL,
FORTRAN, D-series Pascal, or TAL that does not have a valid C name. The
external-name argument is neither modified (for example, upshifted) in any
manner, nor checked to verify that it is a valid identifier for the language of the
external routine.
Considerations for both the native and TNS compilers:
A function pointer is not allowed to have an _alias attribute.
The external-name argument cannot be introduced into the program’s
namespace.
For C++, member functions, function templates and overloaded functions
are not allowed to have an _alias attribute.
_extensible [ ( param-count ) ]
directs the compiler to treat all parameters of the function as though they were
optional, even if some parameters are required by your code. You can add new
formal parameters to an _extensible function without recompiling callers
unless the callers use the new parameter.
Table 2-2. Effects of Function Attributes
Language No attribute _alias _extensible _resident _variable
_c valid valid valid valid valid
_cobol valid valid error ignore error
_fortran valid valid error ignore error
_pascal valid valid valid ignore error
_tal valid valid valid ignore valid
_unspecified valid valid valid ignore valid