[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
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
Coverity example
Host
Ubuntu 22
To Reproduce
Build the Coverity UP example and analyze with codesonar analyze -preset misra2012
Hi @markhermeling ,
Thank you for reporting the issue. This PR #1072 addresses the issue, by changing the type of the variable uxHigherPriorityReadyTasks .
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
Host
To Reproduce
Expected behavior
Screenshots Zipped SARIF file attached 9115254.sarif.zip