Versions Compared

Key

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

...

Accessing a pointer or an object that is not properly aligned can cause a program to crash or give erroneous information, or it can cause slow pointer accesses (if the architecture allows misaligned accesses).

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP36-C

Low

Probable

Medium

P4

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
Compass/ROSE
 
 


Can detect violations of this rule. However, it does not flag explicit casts to void * and then back to another pointer type

Coverity
Include Page
Coverity_V
Coverity_V

MISRA C 2004 Rule 11.4

MISRA C 2012 Rule 11.1

MISRA C 2012 Rule 11.2

MISRA C 2012 Rule 11.5

MISRA C 2012 Rule 11.7

Implemented

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.EXP36

Fully implemented
EDG
   



GCC
Include Page
GCC_V
GCC_V
 

Can detect some violations of this rule when the -Wcast-align flag is used

Klocwork
 
Include Page
Klocwork_V
Klocwork_V

MISRA.CAST.PTR.UNRELATED
MISRA.CAST.PTR_TO_INT
PORTING.CAST.PTR.FLTPNT

PORTING.CAST.PTR
PORTING.CAST.PTR.SIZE
PORTING.CAST.SIZE

 


LDRA tool suite
Include Page
LDRA_V
LDRA_V

94 S, 606 S

Partially implemented
Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
MISRA2004-11_4Fully implemented
Polyspace Bug FinderR2016aUnreliable cast of pointerPointer implicitly cast to different data type
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
3305Fully implemented
PRQA QA-C++
Include Page
cplusplus:PRQA QA-C++_V
cplusplus:PRQA QA-C++_V

3033, 3038

     

PVS-Studio6.22V548, V641General analysis rule set

Related Vulnerabilities

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

...

Key here (explains table format and definitions)

Taxonomy

Taxonomy item

Relationship

CERT CVOID EXP56-CPP. Do not cast pointers into more strictly aligned pointer typesPrior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TR 24772:2013Pointer Casting and Pointer Type Changes [HFC]Prior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TS 17961Converting pointer values to more strictly aligned pointer types [alignconv]Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012Rule 11.1 (required)Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012Rule 11.2 (required)Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012Rule 11.5 (advisory)Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012Rule 11.7 (required)Prior to 2018-01-12: CERT: Unspecified Relationship

Bibliography

...


...