FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

[BUG] Violation of MISRA 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category #1066

Closed markhermeling closed 1 month ago

markhermeling commented 1 month ago

MISRA-C 2012 rule 10.4 says that both operands need to have the same essential type.

Line 3937 of tasks.c reads: else if( uxHigherPriorityReadyTasks != pdFALSE )

Where uxHigherPriorityReadyTasks is an unsigned char and pdFalse is a signed char, thereby violating the rule.

Easiest solution is to add a deviation into MISRA.md and in the code. I will submit a pull request for this issue shortly that makes no code modifications and adds the deviation.

Target

To Reproduce

Expected behavior

Screenshots Zipped SARIF file attached 9115254.sarif.zip

kar-rahul-aws commented 1 month ago

Hi @markhermeling , Thank you for reporting the issue. This PR #1072 addresses the issue, by changing the type of the variable uxHigherPriorityReadyTasks .

kar-rahul-aws commented 1 month ago

Closing this issue , since #1072 is merged.