|
|
HP C/HP-UX Release Notes for HP-UX 11.01: HP 9000 Computers > Chapter 1 New and Changed Features C9X standard macros |
|
The C9X standard-compliant version of "variadic" or variable argument (varargs) macro notation has been added to the HP ANSI C compiler. The notation for C9X standard and for the popular GNU version of varargs is very similar. If you have coded your macros to the GNU standards, you can expect GNU-style behavior using the HP ANSI C compiler. If you have coded your macros to C9X standards, you can expect C9X-style behavior.
Usage differencesIn the HP ANSI C compiler, if there is an ellipsis (...) in the macro definition's argument list, then the trailing arguments (including any separating comma and preprocessing tokens) are merged to form a single item: these are variable arguments. The trailing arguments (including separating commas) are combined and considered as a single argument so that the number of arguments is more than the number of parameters in the macro definition, excluding the ellipsis (...). There are minor usage differences between how C9X and GNU specify variable argument macros are defined: Table 1-1 How C9X and GNU define a variable argument macro
Variable namesVariable names are also handled slightly different by C9X and GNU. Table 1-2 How C9X and GNU refer to varargs in macro replacement text
For example:
|
|