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

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-38
FUNCTION
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.
The extensible and variable attributes cannot both be specified for the same
function.
If you declare an external procedure as unspecified, then the actual procedure
cannot be both written in C and compiled using the OLDCALLS pragma.
Unlike previous methods for declaring external functions, the FUNCTION pragma is
compliant with the ISO/ANSI C standard.
The language attribute tal identifies both TAL and pTAL procedures.
The param-count argument for the extensible attribute can be used only for
native C and C++ programs.
Cfront imposes the following additional restrictions on the FUNCTION pragma:
°
It cannot be used for C++ functions or to change the language attribute.
°
It can be applied only to functions in the global scope.
°
No other pragmas can appear on the same line as a FUNCTION pragma.
°
The resident and alias attributes cannot be used.
C-style variable argument lists (...) cannot be used in variable and extensible
functions.
Extensible and variable functions in native C and C++ can have a maximum of 31
parameters.
Native C++ imposes the following additional restrictions on the FUNCTION pragma:
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