Kimmo Varis
6db365e6f7
Improve path name handling in ErrorLogger.
...
This commit adds setfile() method to FileLocation class. The setfile
method converts in Windows path separators to internally used Unix
separators. And getfile() converts path separators back to Windows
separators. This fixes bugs that error reports had mixed path
separators in paths.
2010-07-17 01:27:40 +03:00
Robert Reif
d72365ab00
Fixed #1375 (false negative: uninitialized member variables not found in nested class constructors)
2010-07-15 10:16:16 +02:00
Kimmo Varis
d811970531
Merge remote branch 'remotes/kimmo/severity-refactor'
2010-07-14 22:29:02 +03:00
Kimmo Varis
fcfa292205
Fix tests after severity-refactor.
...
Now previously used testSeverity is not valid severity.
2010-07-14 21:12:54 +03:00
Robert Reif
fd352865ca
CheckClass: Improvements and refactorings for constructors and variables checking
2010-07-14 19:00:52 +02:00
Daniel Marjamäki
a6b6022497
Fixed #1851 (false positive: Member variable not initialized int ctor)
2010-07-14 18:50:29 +02:00
Kimmo Varis
fa0f6edacf
Rename ErrorMessage::toText() to ErrorMessage::toString().
2010-07-14 18:31:05 +03:00
Daniel Marjamäki
bea714445a
Fixed #1850 (An access to a nested std::map via a negative integer key is reported as 'Array index out of bounds')
2010-07-14 12:24:07 +02:00
Daniel Marjamäki
a1ce80806e
Fixed #1844 (False positive: invalid iterator when erase() is used in if-else (with continue))
2010-07-14 09:42:10 +02:00
Robert Reif
c572e6af87
Fixed #1846 (False positive with -s: Variable hides typedef with same name)
2010-07-13 08:08:12 +02:00
Robert Reif
ab088bcec9
Fixed #1847 (False positive: Method using std::swap<>() can be declared const)
2010-07-13 08:04:48 +02:00
Daniel Marjamäki
61150498c4
Variable Id: fixed issue with function call. Ticket: #1848
2010-07-12 20:18:03 +02:00
Robert Reif
e86e8449f8
Variable usage: better handling of pointer aliasing. Ticket: #1729
2010-07-12 09:50:18 +02:00
Daniel Marjamäki
4b0e3edfa4
Unit Testing: Test that suppressions work
2010-07-09 13:27:15 +02:00
Daniel Marjamäki
2531bb73d7
Fixed #1834 (False positive: invalid iterator when erase() is used in if-else)
2010-07-09 10:50:24 +02:00
Daniel Marjamäki
c34c3ee742
Unused functions: Refactoring
2010-07-08 13:01:53 +02:00
Daniel Marjamäki
11a72461f3
Fixed #1835 (false positive: uninitialized variable when using ?)
2010-07-08 11:16:49 +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
49626e427e
Realloc: changed the error message. I think it's better to mention realloc in the message.
2010-07-07 20:28:15 +02:00
Reijo Tomperi
b5da0b8ed2
Fixed #1650 (Cppcheck deadlock)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1650
2010-07-07 15:42:39 +03:00
Reijo Tomperi
f5d3042635
Add more unit tests
2010-07-07 14:59:42 +03:00
Daniel Marjamäki
a1793edabe
Fixed #1825 (*log(0) error)
2010-07-07 09:03:40 +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
b0f1d5669b
Fixed #1829 (### Internal error in Cppcheck. Please report it.)
2010-07-07 07:40:11 +02:00
Daniel Marjamäki
dc2a0a6468
Fixed #1789 (false positive: memory leak (reallocation in subfunction through parameter))
2010-07-06 21:36:50 +02:00
Daniel Marjamäki
1b20f8d27d
Fixed #1824 (false positive: unitialised variable)
2010-07-06 13:18:28 +02:00
Robert Reif
1799e4a575
Fixed #1827 (### Internal error in Cppcheck. Please report it.)
2010-07-06 08:26:30 +02:00
Robert Reif
c949a29d1e
Fixed #1821 (simplifyTypedef: better typedef support)
2010-07-05 23:03:54 +02:00
Daniel Marjamäki
18a75edd20
Fixed #1823 (tokenize && wrong)
2010-07-05 22:41:02 +02:00
Daniel Marjamäki
b02fc037ed
Buffer Overrun: Fixed false positive when variable is reassigned in called function
2010-07-05 22:19:27 +02:00
Daniel Marjamäki
ae3557fa92
Fixed #1820 (False positive: memory leak (auto deallocated class))
2010-07-05 14:01:25 +02:00
Daniel Marjamäki
b173d5f117
Fixed #1817 (False positive: Resource leak (casting))
2010-07-05 13:16:33 +02:00
Daniel Marjamäki
c811acaa50
Fixed #1818 (False positive: Dangerous usage of strncpy (copying a constant string))
2010-07-05 12:45:39 +02:00
Robert Reif
28c265b20c
Fixed #1821 (simplifyTypedef: better typedef support)
2010-07-02 15:22:29 +02:00
Daniel Marjamäki
3205775eb9
Fixed #1790 (mismatching allocation/deallocation false positive)
2010-06-30 09:21:15 +02:00
Zachary Blair
5ea28ccbba
Fixed #157 (Forgetting to put a break in a switch statement)
2010-06-30 00:10:30 -07:00
Daniel Marjamäki
c6888845a0
Fixed #1815 (False positive: uninitialized variable when using ? operator)
2010-06-30 08:28:34 +02:00
Robert Reif
b33fb48618
Fixed #1816 (Tokenizer: remove restrict keyword)
2010-06-30 08:10:39 +02:00
Daniel Marjamäki
76133e0234
Class checking: Fixed FP for static arrays (not initialized in constructor)
2010-06-29 12:51:18 +02:00
Robert Reif
4668359b51
Fixed #1808 (false positive: uninitialized variable with multiple assignment)
2010-06-29 08:38:24 +02:00
Daniel Marjamäki
46e2f1e64b
--author=Robert Reif <reif@earthlink.net>
...
Fixed #1814 (false positive: Variable hides typedef with same name)
2010-06-28 15:33:27 +02:00
Daniel Marjamäki
f82895c1f2
Fixed #1809 (false positive: uninitialized variable with nested if)
2010-06-26 17:15:44 +02:00
Robert Reif
539804369a
Fixed #1811 (false positive: Uninitialized variable)
2010-06-26 07:50:53 +02:00
Daniel Marjamäki
ad0908cb3f
Fixed #1808 (false positive: uninitialized variable with multiple assignment)
2010-06-25 19:39:30 +02:00
Robert Reif
f3538dd574
Unit Testing: Added TODO test case for uninitialized member variable in operator=. Ticket: #1813
2010-06-25 07:56:40 +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
Daniel Marjamäki
9fd89d3bdc
Fixed #1495 (False -s positive: Member variable not assigned a value in operator=)
2010-06-24 20:09:26 +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
Robert Reif
fac9f66cc0
Fixed #1810 (False positive: Variable 'separator' is assigned a value that is never used)
2010-06-22 17:07:41 +02:00
Robert Reif
a5b45a7f83
Fixed #1807 (false positive: Variable is not assigned a value (casting function parameters))
2010-06-22 17:04:11 +02:00
Daniel Marjamäki
d22da6088c
Fixed #1800 (false positive: memory leak when ptr used as map key)
2010-06-21 18:43:28 +02:00
Robert Reif
bdd28b47aa
Fixed #1799 (false positive: Variable is assigned a value that is never used)
2010-06-21 18:12:01 +02:00
Martin Ettl
866d66ba78
added testcases for testing dangerous functions: mktemp
2010-06-20 13:32:00 +02:00
Nicolás Alvarez
df3d98a7c2
Fix typos in sizeofsizeof error message.
2010-06-19 17:16:14 -03:00
Daniel Marjamäki
85bf4b2be6
Fixed #1795 (false positive: nullpointer dereference (needs to improve Tokenizer::simplifyKnownVariables))
2010-06-19 17:54:38 +02:00
Daniel Marjamäki
82b63dd736
Fixed #1633 (tokenizer: simplifyKnownVariable: improved handling of arithmetic)
2010-06-19 14:00:45 +02:00
Daniel Marjamäki
a402b6bb98
Fixed #1802 (Preprocessor: macros are expanded wrong)
2010-06-19 12:03:39 +02:00
Robert Reif
81403479bd
Refactoring testunusedvariables. This fixes #1804 .
2010-06-18 07:19:26 +02:00
Robert Reif
ec61c6fa26
Fixed #1801 (simplifyTypedef: duplicate typedefs not handled properly)
2010-06-18 07:16:05 +02:00
Reijo Tomperi
0c61454b3f
Added test case deadlock_with_many_errors() for ticket #1650
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1650
The test case is currently commented out, because it would cause tests to hang also.
2010-06-18 00:42:01 +03:00
firewave
d6d4b99b85
Removed obsolete checkheaders from Visual Studio projects
2010-06-17 15:00:58 +02:00
Robert Reif
f116e74f6e
Fixed #1801 (Segmentation fault while scanning Qt's qcups.cpp)
2010-06-17 06:59:01 +02:00
Leandro Lisboa Penz
ad4681223b
Ticket #1789 is not really fixed; added TODO.
2010-06-16 22:47:05 -03:00
Leandro Lisboa Penz
350810e3c1
Improved test of pointer argument realloc.
2010-06-16 22:46:47 -03:00
Leandro Lisboa Penz
58a872e6a0
Fixed #1789 (false positive: memory leak (reallocation in subfunction through parameter))
...
Detecting reallocations in the other function.
2010-06-16 22:29:55 -03:00
Daniel Marjamäki
8a6f4254e0
Fixed #853 (False positive: memory leak for member variable with unknown function)
2010-06-16 19:28:47 +02:00
Robert Reif
ee7ad272d6
variable usage: fix false positives when __attribute__ is used. Ticket: #1792
2010-06-16 18:04:31 +02:00
Robert Reif
7dba21858a
simplify the alias handling in the checking of variable usage. Ticket: #1729
2010-06-16 18:00:21 +02:00
Robert Reif
61e7e759f0
Fixed #1798 (structure templates)
2010-06-16 07:13:52 +02:00
Daniel Marjamäki
dc12a9b3b5
Fixed #1545 (new check: usage of iterator pointing to invalid memory after reserve)
2010-06-15 19:53:09 +02:00
Daniel Marjamäki
a42273da63
Fixed #887 (Tokenizer: Simplify variable value after loop)
2010-06-15 17:56:14 +02:00
Zachary Blair
efefceabae
Fixed #920 (new style check: find empty catch blocks)
2010-06-14 23:45:46 -07:00
Reijo Tomperi
c27e631aa2
Add testthreadexecutor.cpp
2010-06-14 23:18:09 +03:00
Robert Reif
98ae660260
Fixed #1792 (false positive: Variable 'test' is assigned a value that is never used)
2010-06-14 15:46:57 +02:00
Daniel Marjamäki
cb7e9fbec1
Fixed #1776 (False Negative: Unitialized array)
2010-06-14 08:36:34 +02:00
Daniel Marjamäki
e987d2e05b
Memory leaks: more specific bailouts to reduce false negatives
2010-06-13 19:00:11 +02:00
Daniel Marjamäki
37ade20dad
Added testcase for #1557 (false positive: memory leak)
2010-06-13 10:43:23 +02:00
Daniel Marjamäki
5de124280a
Fixed #1783 (false positive: uninitalized variable in constructor/operator=, when calling overloaded functions)
2010-06-13 10:23:59 +02:00
Daniel Marjamäki
70bfa890a8
Fixed #1718 (Tokenizer add close braces to for loop at wrong place when if-else presents inside)
2010-06-13 08:00:46 +02:00
Robert Reif
18bb7488b9
Fixed #1787 (false negative: out of bounds in derived class)
2010-06-13 07:17:50 +02:00
Daniel Marjamäki
76221c0916
Fixed #1510 (false positive '(possible error) Memory leak' when 'a = b = new ...; delete a' (but not b))
2010-06-12 13:37:44 +02:00
Daniel Marjamäki
3a4a151cc4
reverted 'added a todo testcase for ticket #1788 '
2010-06-12 08:36:10 +02:00
Daniel Marjamäki
f3fbdc96e1
Fixed #1788 (Tokenizer: template destructor is lost)
2010-06-12 08:32:05 +02:00
Martin Ettl
69ecc24bf5
added a few testcases for checking memory leaks in classes
2010-06-11 13:33:10 +02:00
Martin Ettl
81828742ac
added a todo testcase for ticket #1788
2010-06-11 13:23:10 +02:00
Martin Ettl
be9c23cb1a
added todo-testcase for ticket #1401
2010-06-10 22:49:34 +02:00
Robert Reif
3d2c28a524
Fixed #1784 (false positive: Variable is not assigned a value)
2010-06-10 07:21:47 +02:00
Robert Reif
6b65b77acf
Fixed #1782 ((error) ### Internal error in Cppcheck. Please report it.)
2010-06-10 07:18:55 +02:00
Daniel Marjamäki
e64ce2e812
Fixed #1781 (false positive: uninitialized variable when using asm statement in macro)
2010-06-09 21:28:15 +02:00
Martin Ettl
c9cd5ea250
added a todo testcase for ticket 1778
2010-06-09 01:21:52 +02:00
Robert Reif
00dcec47ac
Variable usage: read variable when using syntax '..=*(p);'
2010-06-08 18:26:14 +02:00
Robert Reif
f37a7ba934
Variable usage: Added TODO testcases for handling pointer alias. Ticket: #1729
2010-06-06 20:37:48 +02:00
Martin Ettl
0d34416bce
added TODO_TESTCASE for ticket 1734: Array index out of bounds
2010-06-06 16:20:50 +02:00
Martin Ettl
2b557cee45
added a TODO testcase for ticket 1724
2010-06-06 12:46:08 +02:00
Daniel Marjamäki
472bd9dabe
Fixed #1726 (False negative: null pointer dereference in switch block)
2010-06-06 12:15:31 +02:00
Daniel Marjamäki
e140ff6e84
Memory leaks: skipping function call inside allocation
2010-06-06 11:22:59 +02:00