mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 20:03:50 -04:00
Suppress MISRA C rule 11.3 in MISRA.md (#857)
Suppress MISRA C rule 11.3 in MISRA.md
This commit is contained in:
parent
f2637bae55
commit
dabbc05a39
6 changed files with 62 additions and 7 deletions
21
MISRA.md
21
MISRA.md
|
@ -31,6 +31,25 @@ _Ref 8.4.1_
|
|||
a declaration in header file is not useful as the assembly code will
|
||||
still need to declare it separately.
|
||||
|
||||
|
||||
#### Rule 11.3
|
||||
|
||||
_Ref 11.3.1_
|
||||
|
||||
- MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to
|
||||
object type and a pointer to a different object type.
|
||||
This rule prohibits casting a pointer to object into a pointer to a
|
||||
different object because it may result in an incorrectly aligned pointer,
|
||||
leading to undefined behavior. Even if the casting produces a correctly
|
||||
aligned pointer, the behavior may be still undefined if the pointer is
|
||||
used to access an object. FreeRTOS deliberately creates external aliases
|
||||
for all the kernel object types (StaticEventGroup_t, StaticQueue_t,
|
||||
StaticStreamBuffer_t, StaticTimer_t and StaticTask_t) for data hiding
|
||||
purposes. The internal object types and the corresponding external
|
||||
aliases are guaranteed to have the same size and alignment which is
|
||||
checked using configASSERT.
|
||||
|
||||
|
||||
### MISRA configuration
|
||||
|
||||
Copy below content to `misra.conf` to run Coverity on FreeRTOS-Kernel.
|
||||
|
@ -69,4 +88,4 @@ Copy below content to `misra.conf` to run Coverity on FreeRTOS-Kernel.
|
|||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue