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

Add support for Cppcheck 1.64 #165

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 35 additions & 8 deletions sonar-cxx-plugin/src/main/resources/cppcheck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1273,14 +1273,6 @@
Found duplicate if expressions.
</description>
</rule>
<rule>
<key>duplicateBranch</key>
<configkey>duplicateBranch</configkey>
<name>Redundant 'if' and 'else' branches</name>
<description>
Found duplicate branches for if and else.
</description>
</rule>
<rule>
<key>duplicateExpression</key>
<configkey>duplicateExpression</configkey>
Expand Down Expand Up @@ -2693,4 +2685,39 @@
Either the condition is useless or there is division by zero.
</description>
</rule>

<!-- ########### Deprecated as of 1.64 ########### -->
<rule>
<key>duplicateBranch</key>
<configkey>duplicateBranch</configkey>
<name>Redundant 'if' and 'else' branches</name>
<description>
Found duplicate branches for if and else.
</description>
</rule>
<!-- ########### New in cppcheck 1.64 ########### -->
<rule>
<key>negativeMemoryAllocationSize</key>
<configkey>negativeMemoryAllocationSize</configkey>
<name>Memory allocation is negative</name>
<description>
Memory allocation size have to be greater or equal to 0.
</description>
</rule>
<rule>
<key>memsetFloat</key>
<configkey>memsetFloat</configkey>
<name>Memset Float</name>
<description>
The 2nd memset() argument 'varname' is a float, its representation is implementation defined.
</description>
</rule>
<rule>
<key>memsetValueOutOfRange</key>
<configkey>memsetValueOutOfRange</configkey>
<name>Memset Value out of range</name>
<description>
The 2nd memset() argument 'varname' doesn't fit into an 'unsigned char'.
</description>
</rule>
</rules>
17 changes: 17 additions & 0 deletions sonar-cxx-plugin/src/main/resources/default-profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,23 @@
<priority>MINOR</priority>
</rule>

<!-- ########### New 1.64 ########### -->
<rule>
<repositoryKey>cppcheck</repositoryKey>
<key>negativeMemoryAllocationSize</key>
<priority>MAJOR</priority>
</rule>
<rule>
<repositoryKey>cppcheck</repositoryKey>
<key>memsetFloat</key>
<priority>MINOR</priority>
</rule>
<rule>
<repositoryKey>cppcheck</repositoryKey>
<key>memsetValueOutOfRange</key>
<priority>MINOR</priority>
</rule>

<!-- ############################################## -->
<!-- ################# rats rules ################# -->
<!-- ############################################## -->
Expand Down