diff --git a/cxx-sensors/src/main/resources/cppcheck.xml b/cxx-sensors/src/main/resources/cppcheck.xml index 2c42b9ae32..3a29c2685b 100644 --- a/cxx-sensors/src/main/resources/cppcheck.xml +++ b/cxx-sensors/src/main/resources/cppcheck.xml @@ -5799,10 +5799,10 @@ Result of operator '|' is always true if one operand is non-zero. Did you intend knownConditionTrueFalse - Condition 'x' is always true + Condition 'x' is always true or false -Condition 'x' is always true. +Condition 'x' is always true or false.

References

CWE-570: Expression is Always False

CWE-571: Expression is Always True

@@ -5976,7 +5976,7 @@ Boolean value assigned to floating point variable. Invalid test for overflow (undefined behavior) -Invalid test for overflow 'x + u < x'. Condition is always false unless there is overflow, and overflow is UB. +Invalid test for overflow 'x + u < x'. Condition is always false unless there is overflow, and overflow is undefined behaviour.

References

CWE-570: Expression is Always False

]]> @@ -6299,6 +6299,52 @@ The class 'class' has 'operator=' but lack of 'copy constructor'. LINEAR 5min
+ + + unsafeClassDivZero + Public interface of Class is not safe + + +Public interface of Class is not safe. When calling Class::dostuff(), if parameter 'x' is 0 that leads to division by zero. +

+]]> +
+ unsafeClassDivZero + MINOR + CODE_SMELL + LINEAR + 5min +
+ + pointerAdditionResultNotNull + Comparison is wrong. Result of 'ptr+1' can't be 0 + + +Comparison is wrong. Result of 'ptr+1' can't be 0 unless there is pointer overflow, and pointer overflow is undefined behaviour. +

+]]> +
+ pointerAdditionResultNotNull + MAJOR + CODE_SMELL + LINEAR + 5min +
+ + overlappingStrcmp + Multiple suspicious overlapping strcmp + + +The expression 'strcmp(x,"def") != 0' is suspicious. It overlaps 'strcmp(x,"abc") == 0'. +

+]]> +
+ overlappingStrcmp + MINOR + CODE_SMELL + LINEAR + 1min +
asctimeCalled diff --git a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java index b39d7b47e2..e0e2ba4153 100644 --- a/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java +++ b/cxx-sensors/src/test/java/org/sonar/cxx/sensors/cppcheck/CxxCppCheckRuleRepositoryTest.java @@ -41,6 +41,6 @@ public void createRulesTest() { def.define(context); RulesDefinition.Repository repo = context.repository(CxxCppCheckRuleRepository.KEY); - assertEquals(376, repo.rules().size()); + assertEquals(379, repo.rules().size()); } }