C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-37
FUNCTION
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 parameters.
extensible functions are equivalent to EXTENSIBLE procedures in TAL, pTAL,
and D-series Pascal. For more details, see Writing Variable and Extensible
Functions on page 9-4.
Table 13-3 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.
The pragma default settings are:
Usage Guidelines
The FUNCTION pragma can be entered on the compiler RUN command line or in
the source text. For TNS c89, the FUNCTION pragma must be entered in the
source file.
The alias attribute cannot be used with a pointer to a function.
The extensible and variable attributes cannot be specified for a function that
passes or returns a structure by value.
Only one language can be specified for a function.
FUNCTION can be entered in either uppercase or lowercase.
Table 13-3. Effects of FUNCTION Attributes
Language No attribute extensible resident variable alias
c Valid Valid Valid Valid Valid
cobol Valid Error Ignore Error Valid
fortran Valid Error Ignore Error Valid
pascal Valid Valid Ignore Valid Valid
tal Valid Valid Valid Valid Valid
unspecified Valid Valid Ignore Valid Valid
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler Not set Not set
G-series TNS c89 utility Not set Not set
TNS/R native C and C++ compilers Not set Not set
Native c89 utility Not set Not set
TNS/E native C and C++ compilers Not set Not set