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

Change UBaseType_t to BaseType_t for a boolean variable #1072

Merged
merged 1 commit into from
May 24, 2024

Conversation

kar-rahul-aws
Copy link
Member

Description

MISRA-C 2012 rule 10.4 states that : Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category.

In tasks.c , Line 3937
else if( uxHigherPriorityReadyTasks != pdFALSE )

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

This PR addresses this issue by making the variable xHigherPriorityReadyTasks a signed char.

Test Steps

NA

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

#1066

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner May 24, 2024 07:09
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@kar-rahul-aws kar-rahul-aws merged commit ef22228 into FreeRTOS:main May 24, 2024
16 checks passed
@htibosch
Copy link

htibosch commented May 24, 2024

Although this PR is merged and closed, I put in my two cents: within FreeRTOS+TCP and FreeRTOS+FAT we chose BaseType_t as a standard "boolean" value. I most cases, this will be optimised away.

And also we added pdTRUE_SIGNED and pdTRUE_UNSIGNED when a comparison was made with either BaseType_t and UBaseType_t.

I hope that these defines will be adopted by the kernel one day.

AhmedIsmail02 pushed a commit to AhmedIsmail02/FreeRTOS-Kernel that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants