...
Tool | Version | Checker | Description | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Compass/ROSE | Can detect violations of this rule. However, it does not flag explicit casts to | |||||||||||||
| 94 Scastexpr540 S | Fully implemented. | ||||||||||||
EDG | ||||||||||||||
GCC |
| Can detect some violations of this rule when the | ||||||||||||
EDG | ||||||||||||||
Compass/ROSE | Can detect violations of this rule. However, it does not flag explicit casts to | |||||||||||||
| 94 S | Include Page | | ECLAIR_V | ECLAIR_V | Fully implemented. | ||||||||
PRQA QA-C |
| 3305 | Fully implemented. |
...
For objects declared on the stack, the C standard [ISO/IEC 9899:2011] Standard provides alignas
to declare an object to have a stricter alignment. It can be used to resolve the following noncompliant code example.
...
CERT C++ Secure Coding Standard | EXP36-CPP. Do not convert pointers into more strictly aligned pointer types | ||
---|---|---|---|
ISO/IEC TR 24772 | Pointer casting and pointer type changes [HFC] | ||
ISO/IEC TS 17961 | (Draft) Converting pointer values to more strictly aligned pointer types [alignconv] | ISO/IEC TR 24772Pointer casting and pointer type changes [HFC] | |
MISRA-C | Rules Rule 11.2 (required): Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void Rule 11.3 (advisory): A cast should not be performed between a pointer type and an integral type |
Bibliography
[Bryant 2003] | |
---|---|
[ISO/IEC 9899:2011] | Section 6.3.2.53, "TypesPointers" |
[Walfridsson 2003] | Aliasing, Pointer Casts and GCC 3.3 |
...