@@ -36,16 +36,18 @@ _Ref 8.4.1_
36
36
37
37
_ Ref 11.3.1_
38
38
39
- - MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to object
40
- type and a pointer to a different object type.
41
- The rule requires not to cast a pointer to object into a pointer to a
42
- different object to prevent undefined behavior due to incorrectly aligned.
43
- To support static memory allocation, FreeRTOS creates static type kernel
44
- objects which are aliases for kernel object type with prefix "Static" for
45
- data hiding purpose. A static kernel object type is guaranteed to have the
46
- same size and alignment with kernel object, which is checked by configASSERT.
47
- Static kernel object types include StaticEventGroup_t, StaticQueue_t,
48
- StaticStreamBuffer_t, StaticTimer_t and StaticTask_t.
39
+ - MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to
40
+ object type and a pointer to a different object type.
41
+ This rule prohibits casting a pointer to object into a pointer to a
42
+ different object because it may result in an incorrectly aligned pointer,
43
+ leading to undefined behavior. Even if the casting produces a correctly
44
+ aligned pointer, the behavior may be still undefined if the pointer is
45
+ used to access an object. FreeRTOS deliberately creates external aliases
46
+ for all the kernel object types (StaticEventGroup_t, StaticQueue_t,
47
+ StaticStreamBuffer_t, StaticTimer_t and StaticTask_t) for data hiding
48
+ purposes. The internal object types and the corresponding external
49
+ aliases are guarnteed to have the same size and alignment which is
50
+ checked using configASSERT.
49
51
50
52
51
53
### MISRA configuration
0 commit comments