Skip to content

Revert "Fix MISRA C 2012 Rule 13.3 Violations" #995

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

Closed
wants to merge 4 commits into from

Conversation

bradleysmith23
Copy link
Contributor

@bradleysmith23 bradleysmith23 commented Feb 14, 2024

Reverts #988
After further discussion, this PR does not appropriately address this issue and that the use of the volatile qualifier with uxNumberOfItems should be updated to be configLIST_VOLATILE to be inline with the use of this macro across the rest of the file which will be done in a PR following this one.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.53%. Comparing base (8c49c54) to head (63b1301).
Report is 6 commits behind head on main.

❗ Current head 63b1301 differs from pull request most recent head 4f55fc0. Consider uploading reports for the commit 4f55fc0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #995      +/-   ##
==========================================
+ Coverage   93.00%   93.53%   +0.53%     
==========================================
  Files           6        6              
  Lines        3200     3200              
  Branches      879      889      +10     
==========================================
+ Hits         2976     2993      +17     
+ Misses        111       92      -19     
- Partials      113      115       +2     
Flag Coverage Δ
unittests 93.53% <100.00%> (+0.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bradleysmith23 bradleysmith23 marked this pull request as ready for review February 14, 2024 20:37
@bradleysmith23 bradleysmith23 requested a review from a team as a code owner February 14, 2024 20:37
@bradleysmith23 bradleysmith23 marked this pull request as draft February 14, 2024 21:10
@cobusve
Copy link
Member

cobusve commented Feb 14, 2024

Check also the other cases for similar race conditions. I think the post increments and pre-increments should be fine if these variables are in fact not race conditions, and if volatile is required then we need to carefully evaluate what happens when we do a read/modify/write in a non-atomic way on these variables?

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

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

See analysis details on SonarCloud

@kar-rahul-aws
Copy link
Member

We can revert the changes made in the merged PR 988 , since these variables are not in race condition. These variables are only modified in a functionally atomic way ( within critical sections or with the scheduler suspended ) and are either passed by reference into a function or indexed via a volatile variable. The configLIST_VOLATILE macro was added with the motivation for advanced compiler technology , where a compiler might remove essential code leading to compilation error. In those cases, then the volatile qualifier can be inserted in the relevant places within the list structures by simply defining configLIST_VOLATILE to volatile in FreeRTOSConfig.h .

@kar-rahul-aws kar-rahul-aws marked this pull request as ready for review April 10, 2024 06:18
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 marked this pull request as draft April 11, 2024 06:01
@kar-rahul-aws
Copy link
Member

Since the PR #988 does not essentially change the code generated, and it addresses the coverity issues, it works as expected without reverting the said PR. Hence closing this PR #995

@chinglee-iot chinglee-iot deleted the revert-988-Misra13.3 branch April 12, 2024 06:24
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.

5 participants