Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
langc
int a = 81 / (2 + 1 * 2 + 1 * 2 + 1);  /* evaluatesEvaluates to 11 */

which is clearly not the desired result.

...

PRE01-EX2: Macro parameters cannot be individually parenthesized when concatenating tokens using the ## operator, converting macro parameters to strings using the # operator, or concatenating adjacent string literals. The following JOIN() macro below concatenates both arguments to form a new token. The SHOW() macro converts the single argument into a string literal, which is then passed as a parameter to printf(), and as a string and as a parameter to the %d specifier.  For example, if SHOW() is  is invoked as SHOW(66);, the macro would be expanded to printf("66" " = %d\n", 66);.

...

ToolVersionCheckerDescription
ECLAIR
Include Page
ECLAIR_V
ECLAIR_V
macrbodyFully implemented

LDRA tool suite

 
Include Page
LDRA_V
LDRA_V

78 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
3410Fully implemented

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...