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

Table Of Contents
C and C++ Extensions
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
2-18
Operators
For TNS only, _procaddr can be applied only to void *.
A pointer declared with the _procaddr type qualifier cannot be fused to call a
function. The value must be assigned to a typed function pointer and called
through that pointer.
Operators
An expression comprises a sequence of operators and operands. An operator
specifies an operation that results in a value. The items on which the operator acts are
called operands. Operators that act on one operand are referred to as unary operators.
Operators that act on two operands are referred to as binary operators. This
subsection describes the extensions HP has made to the operators defined in the
ISO/ANSI C standard.
_arg_present()
The _arg_present() operator is an HP extension. _arg_present() is used to
determine the presence of a parameter in an extensible or variable function. The
compiler generates code to determine whether the supplied operand is present in the
actual function call. If the operand is present, 1 is returned; otherwise, 0 is returned.
formal-parameter-name
defines the operand on which the _arg_present() operator operates.
Usage Guidelines
The _arg_present() operator is allowed only in an extensible or variable
function.
The formal-parameter-name operand in the _arg_present() operator must
be the name of a formal parameter of the extensible or variable function.
_bitlength()
The _bitlength() operator yields the size, in bits, of its operand. Its operand can be
an expression or the parenthesized name of a type. The size is determined from the
type of the operand, which itself is not evaluated. The result is an integer constant. The
_bitlength() operator is similar to the sizeof() operator, except that for
_bitlength() the result is in bits and the unary-expression can be a bit-field
selection.
unary-expression:
_arg_present (formal-parameter-name)
_bitlength (type-name) | unary-expression