Versions Compared

Key

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

Wiki MarkupParenthesize all parameter names in macro definitions. See also \[[PRE00-A. Prefer inline functions to macros]\] and \[[PRE02-A. Macro replacement lists should be parenthesized]\].

Non-Compliant Code Example

...

When the parameter names are surrounded by commas in the replacement text, regardless of how complicated the actual arguments are, there is no need for parenthesization around parenthesizing the macro parameters.   Since commas have lower precedence than any other operator, there is no chance of the actual arguments being parsed in a surprising way.

...

Risk Assessment

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

...