Versions Compared

Key

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

...

This compliant solution repeats the same type in the sizeof expression and the pointer cast.:

Code Block
bgColor#ccccff
langc
widget *p;

/* ... */

p = (widget *)malloc(sizeof(widget));

...

Tool

Version

Checker

Description

Compass/ROSE

 

 

Can detect some violations of this recommendation when checking EXP36-C. Do not convert pointers into more strictly aligned pointer types.

ECLAIR
Include Page
ECLAIR_V
ECLAIR_V
funcallsFully implemented.

Fortify SCA

5.0

 

Can detect violations of this rule with CERT C Rule Pack.

LDRA tool suite

Include Page
LDRA_V
LDRA_V

 

 

PRQA QA-C
Include Page
PRQA_V
PRQA_V
0695Fully implemented.

Related Vulnerabilities

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

...