Closed chinglee-iot closed 11 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
76f3aa5
) 93.64% compared to head (9a25940
) 93.64%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Fix MISRA C 2012 Rule 10.3 errors
Description
MISRA C 2012 Rule 10.3
MISRA violation The size of constant with suffix
UL
is different for different compiler.For example,
sizeof( 0x01000000UL )
is 4 if using 32-bits GCC compiler. However, it is 8 if using 64-btis GCC compiler. Therefore, assigning a constant with suffixUL
to auint32_t
can cause implicit conversion which may lead to unintended result.The following is an example of the violation. Size of constant eventEVENT_BITS_CONTROL_BYTES is 8 with 64-bits GCC compiler. The statement
uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
causes implicit conversion.Fix In this PR
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.