Versions Compared

Key

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

Parenthesize all parameter names in macro definitions. See also PRE00-C. Prefer inline or static functions to function-like macros and PRE02-C. Macro replacement lists should be parenthesized.

Noncompliant Code Example

...

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

See PRE05-C. Understand macro replacement when concatenating tokens or performing stringification for more information on using the ## operator to concatenate tokens.

...

ToolVersionCheckerDescription

LDRA tool suite

 
Include Page
LDRA_V
LDRA_V

78 S

Fully implemented

ECLAIR

 
Include Page
ECLAIR_V
ECLAIR_V

macrbody

Fully implemented
PRQA QA·CQA-C
Include Page
PRQA_V
PRQA_V
 Fully implemented

...

ISO/IEC 9899:2011 Section 6.10, "Preprocessing directives," and section 5.1.1, "Translation environment"

ISO/IEC PDTR 24772 "JCW Operator precedence/order of evaluation"

MISRA Rule 19.1

Bibliography

[Plum 1985]
[Summit 2005] Question 10.1

...