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

MISRA fixes #153

Merged
merged 12 commits into from
Mar 13, 2024
Merged

MISRA fixes #153

merged 12 commits into from
Mar 13, 2024

Conversation

bradleysmith23
Copy link
Contributor

@bradleysmith23 bradleysmith23 commented Dec 8, 2023

Description

MISRA violations identified through the use of Coverity and here
Fixes to violations of MISRA rule 10.3 and rule 20.12
MISRA rule 10.3 violations: assigning expression of essentially unsigned type to an object with essentially signed type. (int32_t value = 0U;) and assignment of int8_t to a char (char_ c = { 0 }; and char_ n = { 0 };)

MISRA rule 20.12 violation: assert( isOpenBracket_( mode ) ); -> Here, macro parameter isOpenBracket_ (which is also macro) is itself subject for further macro replacement (#expr), supplied as expr parameter.

Test Steps

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

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

@bradleysmith23
Copy link
Contributor Author

/bot run formatting

@bradleysmith23
Copy link
Contributor Author

/bot run formatting

@bradleysmith23 bradleysmith23 marked this pull request as ready for review December 8, 2023 20:14
kstribrnAmzn
kstribrnAmzn previously approved these changes Dec 8, 2023
source/include/core_json.h Outdated Show resolved Hide resolved
Copy link
Contributor

@paulbartell paulbartell left a comment

Choose a reason for hiding this comment

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

It's not clear why we need to change this. There must be a better way to satisfy the customer's MISRA checker.

@bradleysmith23
Copy link
Contributor Author

/bot run formatting

@chinglee-iot
Copy link
Member

MISRA C 2012 rule 20.12 deviation doesn't seem to be fixed when #define configJSON_ASSERT( expr ) assert( exprt )
Creating a new PR #157 to cover this PR.

@AniruddhaKanhere AniruddhaKanhere merged commit 8401d38 into FreeRTOS:main Mar 13, 2024
11 checks passed
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.

9 participants