Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mismatched op-types on line 3937 on tasks.c - Issue 1066 #1067

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ _Ref 8.6.1_
definitions or no definition. FreeRTOS hook functions are implemented in
the application and therefore, have no definition in the Kernel code.

#### Rule 10.4

MISRA C:2012 Rule 10.4

Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category.

_Ref 10.4.1_
- This is a basic comparison of positive values only.

#### Rule 11.1
MISRA C:2012 Rule 11.1: Conversions shall not be performed between a pointer to
function and any other type.
Expand Down
3 changes: 3 additions & 0 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3935,6 +3935,9 @@ void vTaskSuspendAll( void )
* processed. */
xReturn = 0;
}
/* MISRA Ref 10.4.1 [Mismatched Operand Types] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-104 */
/* codesonar[misra_c_2012_rule_10_4_violation] */
Copy link
Member

@aggarg aggarg May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep it consistent with other suppression, can change it to the following:

coverity[misra_c_2012_rule_10_4_violation]

Edit - Ignore my comment. @kar-rahul-aws has raised a PR to address this issue.

else if( uxHigherPriorityReadyTasks != pdFALSE )
{
/* There are tasks in the Ready state that have a priority above the
Expand Down