Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
langc
int a = ((81 / i) * i) * i);  /* evaluatesEvaluates to 243 */

which is not the desired behavior.

...

In this noncompliant code example, END_OF_FILE is defined as -1. The macro replacement list consists of a unary negation operator , followed by an integer literal 1:

...

In this example, the programmer has mistakenly omitted the comparison operator from the conditional statement, which should be getchar() != END_OF_FILE. (See MSC02-C. Avoid errors of omission.) After macro expansion, the conditional expression is incorrectly evaluated as a binary operation: getchar()-1. This statement is syntactically correct, even though it is certainly not what the programmer intended. Note that this example also violates DCL00-C. Const-qualify immutable objects.

...

ToolVersionCheckerDescription

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

macrbody

Fully implemented

LDRA tool suite

Include Page
LDRA_V
LDRA_V

77 S
78 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
3409Fully implemented

Related Vulnerabilities

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

...