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

Suppress MISRA C:2012 rule 11.5 deviations #878

Merged
merged 16 commits into from
Dec 6, 2023

Conversation

chinglee-iot
Copy link
Member

Suppress MISRA C:2012 rule 11.5 deviations

Description

MISRA C:2012 Rule 11.5

A conversion should not be performed from pointer to void into pointer to object

MISRA deviations

The rule requires a pointer to void should not be converted into a pointer to object cause this may result in a pointer that is not correctly aligned, resulting in undefined behavior. Casting void * to a pointer to other type is used in the following scenarios:

  • Casting the pointer to memory block returned by pvPortMalloc to other types.
  • Opaque pointer for data hiding purposes
  • List item owner for general use cases
  • Callback function parameters for general use cases

Suppress in this PR

  • Elaborate the reason to suppress this rule by comment.

Test Steps

N/A

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.

@chinglee-iot chinglee-iot requested a review from a team as a code owner November 3, 2023 09:38
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (cd5c774) 93.77% compared to head (d70d104) 93.77%.

Files Patch % Lines
tasks.c 86.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #878   +/-   ##
=======================================
  Coverage   93.77%   93.77%           
=======================================
  Files           6        6           
  Lines        3179     3179           
  Branches      885      885           
=======================================
  Hits         2981     2981           
  Misses         91       91           
  Partials      107      107           
Flag Coverage Δ
unittests 93.77% <92.59%> (ø)

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.

MISRA.md Show resolved Hide resolved
aggarg
aggarg previously approved these changes Dec 5, 2023
Copy link

sonarqubecloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@chinglee-iot chinglee-iot merged commit 84c0047 into FreeRTOS:main Dec 6, 2023
16 of 17 checks passed
@aggarg aggarg deleted the fix-misra-11.5 branch December 6, 2023 07:50
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