You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
in include/semphr.h, line 675:
#define xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )
In the same file, line 26:
#ifdef xSemaphoreTakeFromISR
#hard_undef xSemaphoreTakeFromISR
BaseType_t xSemaphoreTakeFromISR( SemaphoreHandle_t xSemaphore, BaseType_t * const pxHigherPriorityTaskWoken )
The macro and the function have the same name, which is a violation of rule 5.5
The same happens to xSemaphoreGive at line 460 and 23
Target
UP and SMP configurations of the Coverity example
Host
Linux
To Reproduce
Run codesonar analyze -preset misra2012 on the Coverity example
Expected behavior
Either add a deviation, or change the code to have none distinct names for the macro and the function
Hi @markhermeling
Thanks for reporting the issue.
We only see the function prototypes in the comments as pointed out by @RichardBarry .
This would likely not cause an issue, since the macro definitions are proper in the source include file.
Could you please provide more information on the lines( which are not comments ) which have similar issue.
Ah, I see what is going on. Let me retract this bug. This configuration of FreeRTOS used a #define for xSemaphoreTakeFromISR, where the CodeSonar model for FreeRTOS is expecting a function and the two are clashing.
This is not a problem in FreeRTOS, sorry for the noice
Describe the bug
in include/semphr.h, line 675:
#define xSemaphoreTakeFromISR( xSemaphore, pxHigherPriorityTaskWoken ) xQueueReceiveFromISR( ( QueueHandle_t ) ( xSemaphore ), NULL, ( pxHigherPriorityTaskWoken ) )
In the same file, line 26:
#ifdef xSemaphoreTakeFromISR
#hard_undef xSemaphoreTakeFromISR
BaseType_t xSemaphoreTakeFromISR( SemaphoreHandle_t xSemaphore, BaseType_t * const pxHigherPriorityTaskWoken )
The macro and the function have the same name, which is a violation of rule 5.5
The same happens to xSemaphoreGive at line 460 and 23
Target
Host
To Reproduce
Run codesonar analyze -preset misra2012 on the Coverity example
Expected behavior
Either add a deviation, or change the code to have none distinct names for the macro and the function
Screenshots
SARIF file attached
MISRA-violation-5.5.sarif.zip
The text was updated successfully, but these errors were encountered: