Skip to content

Conversation

@kar-rahul-aws
Copy link
Member

@kar-rahul-aws kar-rahul-aws commented Oct 20, 2023

Fix MISRA_C_2012 rule 8.2 violation

Description

Misra Rule 8.2

Function types shall be in prototype form with named parameters.

MISRA violation
The parameters in any function prototype should be named. The parameter names can provide useful information regarding the function interface and a mismatch between a declaration and definition might be indicative of a programming error.
The function prototype:

typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
                                    UBaseType_t );

Fix

  • Assign names to the parameters in the function prototype.

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.

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

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71d86f9) 93.77% compared to head (cfdd1e6) 93.77%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #845   +/-   ##
=======================================
  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% <ø> (ø)

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.

@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner November 1, 2023 16:06
Copy link
Member

@chinglee-iot chinglee-iot left a comment

Choose a reason for hiding this comment

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

Can we also elaborate what could be the problem if parameter name is not specified in the prototype?
Suggest we still following the naming convention for the parameters.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aggarg aggarg merged commit 22eb827 into FreeRTOS:main Dec 6, 2023
@aggarg aggarg deleted the fix_misra_8_2 branch December 6, 2023 16:23
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