Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#define FOO(a, b, c) bar(a, b, c)
/* ... */
FOO(arg1, arg2, arg3);

When token pasting or stringization is performed, stringization, and string concatenation are desired, the arguments must not be parenthesized individually.

Code Block
#define JOIN(a, b) (a ## b)
#define SHOW(a) printf(#a " = %d\n", a) 

Risk Assessment

Failing to parenthesize the parameter names in a macro can result in unintended program behavior.

...