Skip to content

Commit

Permalink
Add support for cppcheck 1.64
Browse files Browse the repository at this point in the history
  • Loading branch information
jmecosta authored and Waleri Enns committed Apr 25, 2014
1 parent b299b75 commit 74c590d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
31 changes: 30 additions & 1 deletion sonar-cxx-plugin/src/main/resources/cppcheck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2608,10 +2608,36 @@
A function gets passed an invalid argument. A non-boolean value is required.
</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 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 doesn't fit into an 'unsigned char'.
</description>
</rule>
</rules>


<!-- ########### Deprecated in 1.63 ########### -->
<!-- ########### Deprecated as of 1.63 ########### -->
<!-- tooBigSleepTime -->
<!-- dangerousUsageStrtol -->
<!-- wrongcctypecall -->
Expand All @@ -2636,3 +2662,6 @@
<!-- invalidLengthModifierError -->
<!-- tooBigSleepTime -->
<!-- class_X_Y -->

<!-- ########### Deprecated as of 1.64 ########### -->
<!-- duplicateBranch -->
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 @@ -1499,6 +1499,23 @@
<priority>MAJOR</priority>
</rule>

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

<!-- ############################################## -->
<!-- ################# rats rules ################# -->
<!-- ############################################## -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public class CxxCppCheckRuleRepositoryTest {
public void createRulesTest() {
CxxCppCheckRuleRepository rulerep = new CxxCppCheckRuleRepository(
mock(ServerFileSystem.class), new XMLRuleParser(), new Settings());
assertEquals(295, rulerep.createRules().size());
assertEquals(298, rulerep.createRules().size());
}
}

0 comments on commit 74c590d

Please sign in to comment.