Robert Reif
2dd93dff75
move unused variable checks from checkother to checkunusedvar
2011-08-19 14:35:25 -04: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
9a4447c835
add support for unused const local variables
2011-07-24 12:09:59 -04:00
Robert Reif
c3c3eb74e8
fix #2929 (Additional Unused variable check)
2011-07-21 18:37:37 -04:00
Robert Reif
270b2b1772
fix #2904 (Memory leak not detected when creating a new class instance)
2011-07-14 19:15:59 -04: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
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
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
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
Daniel Marjamäki
5175e4ff3f
Fixed #2535 (false positive: (style) Variable 'A' is not assigned a value)
2011-02-09 19:20:44 +01:00
Pete Johns
098f0bf3e6
Fixed #2526 (Make TODO_ASSERT_EQUALS take three arguments (value, to_be, as_is)?...
...
Removed replaced EXPECTED with...
WANTED (to-be): The future expected value.
CURRENT (as-is): Documenting how cppcheck behaves now.
This removes the need for an ASSERT_EQUALS but enforces the check for every TODO_ASSERT_EQUALS.
2011-01-30 23:20:11 +11:00
Reijo Tomperi
226b605774
Change year 2010 -> 2011 in license texts.
2011-01-09 21:33:36 +02:00
Daniel Marjamäki
92acca3d0c
Fixed #2368 (assigned a value that is never used)
2010-12-27 20:49:07 +01:00
Ettl Martin
ccde32b210
Created to testcase ( #2368 ) for assigned a value that is never used false positive
2010-12-27 15:12:17 +01:00
Daniel Marjamäki
ecad249ae2
Fixed #2346 (False positive: pointer is assigned value that is never used. used here: 'pCol = pCol->GetNext()')
2010-12-25 19:17:53 +01:00
Daniel Marjamäki
0f9415a5fb
Fixed #2330 (unreadVariable error for a fstream object when only extraction operator (>>) is used)
2010-12-21 19:02:00 +01:00
Robert Reif
244974a61a
unused variables: fixed false negatives with the help of the symbol database. ticket: #2317
2010-12-21 08:13:40 +01:00
Daniel Marjamäki
f73cce9eca
Fixed #2317 ((style) Variable is allocated memory that is never used)
2010-12-20 18:31:16 +01:00
Daniel Marjamäki
02892499d2
Fixed #2286 (Variable 'ownKilled' is assigned a value that is never used)
2010-12-19 18:27:31 +01:00
Daniel Marjamäki
b25e6ff24c
Fixed #2279 ((style) struct of union member is never used)
2010-12-05 18:33:53 +01:00
Daniel Marjamäki
93ebdca313
Fixed #2264 (False positive: variable assigned value that is never used)
2010-12-03 18:45:49 +01:00
Daniel Marjamäki
8118e4755a
Fixed #2263 (False positive: variable assigned value that is never used)
2010-12-02 20:08:05 +01:00
Robert Reif
f12c0c7ada
Tokenizer: add assert(_settings) to Tokenizer to insure the tokenizer always has settings. Ticket: #2219
2010-12-01 18:00:55 +01:00
Daniel Marjamäki
d250cb5aa2
Fixed #2206 (False positive: variable is assigned a value that is never used (array initializers))
2010-11-15 17:53:55 +01:00
Daniel Marjamäki
7b3e7f6467
Fixed #2205 (False positive: variable is assigned a value that is never used (assigning to dereferenced casted pointers))
2010-11-15 17:30:07 +01:00
Zachary Blair
36d80d6eaa
Fixed #2058 (Warn for unused variable when only doing malloc/free)
2010-11-14 17:37:36 -08:00
Daniel Marjamäki
19f809c9b4
Unused variables: better handling of '= %var% ++'. Ticket: #2160
2010-11-02 20:01:12 +01:00
Daniel Marjamäki
558899dc74
Variable usage: Fixed false negative that I introduced when simplifying compound assignments
2010-10-31 09:34:25 +01:00
Daniel Marjamäki
23d3fd3a5a
Fixed #2147 (uninitialized variable: false negative for 'x += y;')
2010-10-31 08:47:13 +01:00
Daniel Marjamäki
0afd19c59b
Fixed #2039 (unions not handled properly, false positive about initialization)
2010-09-09 20:15:00 +02:00
Daniel Marjamäki
9415423352
Fixed #2017 (false positive::struct or union member 'Base::m_ui' is never used)
2010-09-04 11:21:34 +02:00
Daniel Marjamäki
8ff1e71b22
Fixed #2004 (False positive in 'variable assigned a value but is never used' check)
2010-08-31 20:58:37 +02:00
Daniel Marjamäki
1d78b5072d
Fixed #1996 (False positive for 'Variable foo is assigned a value that is never used')
2010-08-31 20:33:28 +02:00
Daniel Marjamäki
71453871d4
Fixed #1989 (false positive: Variable 'Aux13' is assigned a value that is never used)
2010-08-28 13:32:43 +02:00
Daniel Marjamäki
83a8879f11
Tokenizer::simplifyInitVar : Refactorings and fixes related to ticket #1989
2010-08-27 22:58:21 +02:00
Robert Reif
4a6070d2af
fix 2 problems related to ticket 1976:
...
1. nested unnamed anonymous structures and unions were not supported.
2. declaration split up in class had bug if proceeded by access specifier.
2010-08-25 20:17:31 +02:00
Daniel Marjamäki
ed4f1164a1
Fixed #1894 (unreadVariable false positive with const references)
2010-08-07 15:53:51 +02:00
Robert Reif
e86e8449f8
Variable usage: better handling of pointer aliasing. Ticket: #1729
2010-07-12 09:50:18 +02:00
Robert Reif
566b4b4beb
Variable usage: fixed false positive reported in #1729
2010-07-08 08:42:34 +02:00
Robert Reif
2d6dfa57e1
Variable usage: Better aliasing support (Ticket #1729 )
2010-07-08 08:00:50 +02:00
Daniel Marjamäki
4ebf4caf66
Variable usage: only warn about variables that have variable id > 0
2010-07-07 08:50:34 +02:00
Daniel Marjamäki
2bb07a55bd
Fixed #1803 (False positive: unused variable: this)
2010-07-07 08:39:18 +02:00
Daniel Marjamäki
a107cd1b59
Fixed #1729 (False positive: variable is assigned a value that is never used (pointer aliasing))
2010-07-07 08:26:24 +02:00
Robert Reif
4668359b51
Fixed #1808 (false positive: uninitialized variable with multiple assignment)
2010-06-29 08:38:24 +02:00
Robert Reif
38f90dae09
Fixed #1813 (false negative: Member variable not assigned a value in operator=)
2010-06-25 07:52:12 +02:00
Robert Reif
2a1edff77f
Fixed #1812 (false negative: functionVariableUsage doesn't support static variables)
2010-06-24 17:00:32 +02:00
Robert Reif
74e48d4bb1
Fixed #1732 (False positive: Variable not assigned a value (pointer to pointer))
2010-06-23 06:54:14 +02:00