5.69 Macros with a variable number of arguments in C99

You can declare a macro in C99 that accepts a variable number of arguments.

The syntax for defining such a macro is similar to that of a function. For example:

#define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
void Variadic_Macros_0()
{
    debug ("a test string is printed out along with %x %x %x\n", 12, 14, 20);
}
Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.