[previous] MISRA-C:2004  Rule  11.4:  (Advisory) [next] A cast should not be performed between a pointer to object type and a different pointer to object type.
Conversions of this type may be invalid if the new pointer type requires a stricter alignment.

uint8_t  *p1;
uint32_t *p2;

p2 = ( uint32_t * )p1;    /* Incompatible alignment ? */


QAC messages that encompass this guideline:

0310 Casting to different object pointer type.
0316 [I] Cast from a pointer to void to a pointer to object type.
0317 [I] Implicit conversion from a pointer to void to a pointer to object type.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents