Daniel Marjamäki
40b493e621
Improve check: Clarify condition (using boolean result in bitwise operation)
2011-08-19 13:40:54 +02:00
Daniel Marjamäki
0d7c80ef21
improved comment of previous commit
2011-08-19 07:28:15 +02:00
Daniel Marjamäki
4606251ce8
Fixed #3001 (False Positive: Redundant assignment to itself)
2011-08-19 07:23:11 +02:00
Daniel Marjamäki
e5ff920ea9
Suspicious condition: Better handling when rhs is non-numeric
2011-08-19 00:56:15 +02:00
Daniel Marjamäki
a7728fef48
New check: warn about such suspicious conditions: '(a & b == c)'
2011-08-19 00:15:20 +02:00
Daniel Marjamäki
4f962acf16
Fixed #3009 (Using numeric constants in kernel space code)
2011-08-16 20:16:33 +02:00
Robert Reif
ad45ba718c
convert CheckOther::checkCharVariable() to use symbol database
2011-08-14 10:39:45 -04:00
Robert Reif
cd2c0fd9c8
convert CheckOther::checkSizeofForNumericParameter() to use the symbol database
2011-08-14 10:21:07 -04:00
Robert Reif
741eabba16
convert CheckOther::checkIncrementBoolean() to use the symbol database
2011-08-14 10:16:39 -04:00
Daniel Marjamäki
003956e42e
Fixed #2982 (false positive: using char type as array index (using string as key))
2011-08-09 17:03:22 +02:00
Daniel Marjamäki
8a6a999f09
Fixed #2979 (Improve message: using char as array index)
2011-08-08 19:35:11 +02:00
Kimmo Varis
cfcfa3f000
Use "enabled" list for the style checking.
...
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.
Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Robert Reif
85b2bd21dc
fix #2968 (new check: testing if unsigned variable is less than 0)
2011-08-06 19:23:09 -04:00
Moritz Lipp
8d68981119
Fixed #2793 (SIGABRT on filenames without file extension)
2011-07-31 18:35:28 +02:00
Robert Reif
2f4aee2923
fix missing else in patch that added support for unused const local variables
2011-07-30 07:16:59 -04:00
Robert Reif
cb4282d69a
use simpleMatch where possible in checkother.cpp
2011-07-29 22:37:05 -04:00
Daniel Marjamäki
dc629b4c39
Fixed 'possible null pointer dereference' warning messages
2011-07-28 08:12:21 +02:00
Daniel Marjamäki
d2c0e5e7e6
Fixed #2821 (New Check : bool pointer null truth assignment)
2011-07-28 07:28:24 +02:00
Robert Reif
9a4447c835
add support for unused const local variables
2011-07-24 12:09:59 -04:00
Simon Martin
539c2e5acb
Fixed #2932 (segmentation fault of cppcheck ( i / i ))
2011-07-24 09:06:38 +02:00
Robert Reif
c3c3eb74e8
fix #2929 (Additional Unused variable check)
2011-07-21 18:37:37 -04:00
Robert Reif
ed30edf9d3
simplify CheckOther::checkIncorrectLogicOperator() by using more pattern matching
2011-07-18 07:34:49 -04:00
Robert Reif
76d0872c0d
made #2827 fix more generic by adding more ops and using pattern matching rather than string matching
2011-07-17 16:28:00 -04:00
Robert Reif
4149617978
fix #2827 to use numeric comparisons
2011-07-16 23:05:35 -04:00
Robert Reif
430d22032d
fix #2827 condition always false or true)
2011-07-16 22:06:23 -04:00
Zachary Blair
997a3652d2
Fixed #2822 (New check: Duplicate break statements in switch)
2011-07-14 17:12:56 -07:00
Robert Reif
270b2b1772
fix #2904 (Memory leak not detected when creating a new class instance)
2011-07-14 19:15:59 -04:00
Daniel Marjamäki
0007351ef4
spell check of error message. contant => constant
2011-07-05 19:59:58 +02:00
Daniel Marjamäki
8cd2c3115e
Fixed #2866 (Detect sign extension bugs)
2011-07-05 18:41:27 +02:00
Greg Hewgill
657b003dc8
Fix spelling error in warning identifier
2011-07-05 19:54:23 +12:00
Robert Reif
b32b2c6d87
add support for checking unused std::string local variables
2011-07-02 19:25:10 -04:00
Robert Reif
301e59cea0
fix false positive for unused local class/struct variable
2011-07-01 08:45:29 -04:00
Robert Reif
18e6509c5d
add support in CheckOther::functionVariableUsage() for checking structures that are declared with struct keyword
2011-07-01 07:42:20 -04:00
Robert Reif
3225c9dd9b
cleanup isStatic in CheckOther::functionVariableUsage()
2011-07-01 07:15:59 -04:00
Robert Reif
7826b5e22d
add support for detecting unused function variables of type class or struct
2011-06-30 21:58:11 -04:00
Daniel Marjamäki
97d47fa20e
Fixed #2805 (false positive: [NotAssigned1.cpp:5]: (style) Variable 'y' is not assigned a value)
2011-06-08 19:54:01 +02:00
seb777
e06b2419a4
fix #2786 (new check: Using sizeof with numeric constant)
...
Add unit test and improve check with negative constant because in cppcheck %num%
means 'integer'
2011-05-28 16:40:01 +08:00
seb777
287840e6bc
fix #2786
2011-05-25 01:45:58 +08:00
Daniel Marjamäki
144d811e54
Fixed #2780 (false positive: variable p is not assigned a value 'int p[2]; *p = 0;')
2011-05-11 18:58:25 +02:00
Robert Reif
2db67863a7
#2700 (common logic or cut and paste errors) make duplicate branches inclnclusive
2011-05-08 13:22:42 -04:00
Daniel Marjamäki
3629f953f0
Fixed #2770 (False positives (scope can be reduced / variable is assigned value that is never used))
2011-05-06 21:16:01 +02:00
Zachary Blair
46645ab327
Fixed #2722 (new check: statement that is always true (strcmp))
2011-04-25 22:45:27 -07:00
Daniel Marjamäki
46afc54c10
astyle formatting
2011-04-20 06:41:26 +02:00
Daniel Marjamäki
8417c4eb28
const parameter: Added comment to reduce false negatives for various classes in the std namespace
2011-04-20 05:40:06 +02:00
Daniel Marjamäki
68e7003bb1
Fixed #2734 (False positive: reports 'should be passed by reference' for std::streamoff)
2011-04-19 20:07:54 +02:00
Robert Reif
c238b1bba6
fix #2730 (The same expression on both sides of != is OK when checking for NaN)
2011-04-18 19:20:27 -04:00
Robert Reif
56212370d1
add check for same expression on both sides of an operator (part of #2700 )
2011-04-10 10:25:02 -04:00
Robert Reif
434783530a
Merge branch 'master' of github.com:danmar/cppcheck
2011-04-10 09:57:34 -04:00
Robert Reif
4a50aca7b2
fix a bug in checkDuplicateBranch where removed type info like signed/unsigned was not checked for difference
2011-04-10 09:57:09 -04:00
Daniel Marjamäki
e5d43d4ed2
Renamed Settings::stupid to Settings::experimental
2011-04-10 15:55:08 +02:00