-
Notifications
You must be signed in to change notification settings - Fork 38
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 updates #67
Merged
Merged
Misra updates #67
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2f719e7
Added rules to the misra config file to ignore when running a coverity
e040a48
Updating the MISRA.md file to match the misra.config file.
5be4902
Removal of an enum to fix a 10.1 MISRA violation, swapping it to a
d46c4e9
Changing DISABLE_LOGGING to DISABLE_ASSERT to be accurate
cb073d7
Merge branch 'aws:main' into misraUpdates
Skptak cf68cef
Swapping MISRA.md format, using DNDEBUG for removal of assert when ru…
62d8544
Doxygen/Formatting fixes
3aa1a37
Doxygen changes
0d8d3d3
We've decided to keep the ENUM and use a switch statement to get past
840aa3b
Swapping to a default carrying last possible value for line coverage
e7a2c96
The switch statement was sending the complexity to a score of 15.
8ae1b1c
Updated size_table.md
c89b002
Turns out you only need an empty else if you have else ifs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
|
||
# MISRA Compliance | ||
|
||
The jobs library files conform to the [MISRA C:2012](https://www.misra.org.uk) | ||
guidelines, with some noted exceptions. Compliance is checked with Coverity static analysis. | ||
Deviations from the MISRA standard are listed below: | ||
|
||
### Ignored by [Coverity Configuration](tools/coverity/misra.config) | ||
| Deviation | Category | Justification | | ||
| :-: | :-: | :-: | | ||
| Directive 4.9 | Advisory | Allow inclusion of function like macros. | | ||
| Rule 3.1 | Required | Allow nested comments. C++ style `//` comments are used in example code within Doxygen documentation blocks. | | ||
| Rule 20.12 | Required | Allow use of `assert()`, which uses a parameter in both expanded and raw forms. | | ||
The specific deviations, suppressed inline, are listed below. | ||
|
||
### Flagged by Coverity | ||
| Deviation | Category | Justification | | ||
| :-: | :-: | :-: | | ||
| Rule 2.5 | Advisory | A macro is not used by the library; however, it exists to be used by an application. | | ||
| Rule 8.7 | Advisory | API functions are not used by the library; however, they must be externally visible in order to be used by an application. | | ||
Additionally, [MISRA configuration file](https://github.com/aws/Jobs-for-AWS-IoT-embedded-sdk/blob/main/tools/coverity/misra.config) contains the project wide deviations. | ||
|
||
### Suppressed with Coverity Comments | ||
| Deviation | Category | Justification | | ||
| :-: | :-: | :-: | | ||
| Rule 10.1 | Required | A variable of an enum type is used to iterate over contiguous values. | | ||
To find the violation references in the source files run grep on the source code | ||
with ( Assuming rule 11.4 violation; with justification in point 2 ): | ||
``` | ||
grep 'MISRA Ref 11.1.4' . -rI | ||
``` | ||
|
||
*None.* | ||
Skptak marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep is typically only found on unix operating systems by default. could we not just add the grep output in a table here? why make users run it themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied the grep from FreeRTOS+TCP MISRA changes as seen here, as I was told to make the formatting of these files/MISRA changes the same across the various repos.
Since this repo currently doesn't have any suppressed violations I see nothing wrong with removing the grep and just stating that in the file for now, I had left it there to be consistent was all.
I imagine the general idea for the inclusion of the grep instead of the table is to handle line changes when commits happen. For example corePKCS11 has upwards of 50-60 inline suppressions, so adding a table to that would require a bit of overhead to ensure it stays accurate.