2466 Commits

Author SHA1 Message Date
Erik Lax
aeae5a867d Fixed #2550 (Bad substr/strncmp comparison) 2011-02-08 19:49:29 +01:00
Robert Reif
1e0d538273 checkautovariables: refactor to use the symbol database 2011-02-07 19:26:34 -05:00
Daniel Marjamäki
7c9e52546d Fixed #2552 (preprocessor check XX is already guaranteed to be defined -- too eager?) 2011-02-07 20:26:29 +01:00
Zachary Blair
daa04872a0 Merge branch 'master' of github.com:danmar/cppcheck 2011-02-06 01:31:09 -08:00
Daniel Marjamäki
26f017e9c6 scripts: added tabs.pl - in my opinion it is bad to use tabs inside string constants. spaces or \t should be used instead. 2011-02-05 12:53:28 +01:00
Zachary Blair
8a494cf8bb Fixed #2388 (Use throw without argument to rethrow exceptions) 2011-02-05 01:11:09 -08:00
Robert Reif
95e917b27f Tokenizer: Replace __null with 0 (gcc constant) 2011-02-05 09:03:31 +01:00
Robert Reif
c592ccd35d Fixed #2547 (segmentation fault of cppcheck) 2011-02-05 08:59:59 +01:00
Daniel Marjamäki
5640845a17 Fixed #2498 (False positive: redundant assignment) 2011-02-04 21:08:42 +01:00
Daniel Marjamäki
dbc5929fa2 Fixed #2503 (false positive: memory leak (struct member, address is taken)) 2011-02-04 20:41:35 +01:00
Robert Reif
f87056fca3 Fixed #2539 (segmentation fault of cppcheck) 2011-02-04 20:19:49 +01:00
Daniel Marjamäki
447d29938e Fixed #2544 (XML output does not specify encoding used) 2011-02-04 20:14:19 +01:00
Daniel Marjamäki
39c68e12ce Fixed #2533 (false positive: (error) Uninitialized variable: cBuffer) 2011-02-03 22:29:32 +01:00
Daniel Marjamäki
398190460f astyle formatting 2011-02-03 22:20:59 +01:00
Kimmo Varis
85187dca07 Update VS 2008/2010 project files for tests. 2011-02-03 17:53:50 +02:00
Kimmo Varis
2d6d8580d7 Allow to exclude filenames (with paths).
This expands the CLI exclude feature to also allow excluding
filenames (with paths). When filename with recognized extension
is given to -i option then matching filenames (with paths) are
ignored when checking.

Ticket #2538 (Allow excluding files from the checking)
2011-02-03 14:43:42 +02:00
Kimmo Varis
9b9b9c99f5 Add test for XML format version 2. 2011-02-03 09:44:23 +02:00
Kimmo Varis
f65fa338a5 Tighten the directory name mathing with -i.
Only match full directory names as parts of whole paths. So -isrc
matches src/file.cpp and proj/src/file.cpp. But does not match
mysrc/file.cpp or proj/srcfiles/file.cpp.
2011-02-03 09:01:43 +02:00
Robert Reif
e9ec4bc3e4 Fixed #2536 (cppcheck hangs with 100% cpu load) 2011-02-03 07:58:49 +01:00
Robert Reif
8288c28b3f Fixed #2537 (segmentation fault of cppcheck) 2011-02-03 07:57:10 +01:00
Kimmo Varis
bacb234534 Add testsymboldatabase.cpp to test.pro.
Also add comment explaining omitting testfilelister_unix.cpp.
2011-02-02 22:52:47 +02:00
Kimmo Varis
ffc4bb481b Merge branch 'ignore-paths-cli' 2011-02-02 21:09:22 +02:00
Raphael Geissert
d592250284 Fix sizeof sizeof check to handle sizeof(sizeof type) 2011-02-02 11:49:32 -06:00
Daniel Marjamäki
9a383388be xml2: added <errors> element 2011-02-02 18:46:07 +01:00
Daniel Marjamäki
26b21a5ae0 Merge branch 'sorted-instances' 2011-02-02 18:35:42 +01:00
Kimmo Varis
84a988ec50 Update VS2008/VS2010 project files. 2011-02-02 14:37:48 +02:00
Kimmo Varis
3fc0d0f03e Run dmake to update Makefile. 2011-02-02 14:36:45 +02:00
Kimmo Varis
6401271ceb Add CLI support for ignoring paths.
Add support for giving list of ignored paths from CLI. This way
user can define paths one doesn't want to check (like generated
code). This first simple implementation only does exact matching,
no support for wildcards etc. And matching is always agains dir
names.

If the filtered dir name is part of the checked filename then the
file is ignored.

Ticket #1690 (Ability to exclude files and directories from checks)
2011-02-02 14:34:04 +02:00
Kimmo Varis
1da88de932 Imrove --xml-version option parsing.
Allow --xml-version parsing to recognize also version 1 and print
errors about invalid values.
2011-02-02 14:04:50 +02:00
Kimmo Varis
1118b132b9 Add couple of tests for xml-version cmd line option. 2011-02-02 13:33:57 +02:00
Greg Hewgill
c3ad3f78e9 test case to check whether instances are sorted 2011-02-02 22:58:24 +13:00
Robert Reif
8eb92001b3 Fixed #2530 (Tokenizer: Remove redundant 'MyClass::' inside MyClass class declaration) 2011-02-02 07:40:08 +01:00
Daniel Marjamäki
defeded4b5 Fixed #2529 (False positive: array 'req[3]' index 4 out of bounds) 2011-02-01 21:46:07 +01:00
Pete Johns
2d1ccad44e Turned failing ASSERT_EQUALS into TODO_ASSERT_EQUALS. 2011-02-01 19:55:39 +11:00
Pete Johns
d2b6dc210b Merge https://github.com/ghewgill/cppcheck 2011-02-01 19:52:44 +11:00
Greg Hewgill
dcc0f28f34 check that misused scope object does not pick nested class 2011-02-01 08:07:41 +13:00
Daniel Marjamäki
202c8eb4a0 Fixed #2525 (False positive 'Possible null pointer dereference') 2011-01-31 17:30:27 +01:00
Daniel Marjamäki
757c840633 astyle formatting 2011-01-31 17:26:07 +01:00
Ettl Martin
f3111b541e #2528 added todo-testcase 2011-01-31 13:46:51 +01:00
Raphael Geissert
66253af1e5 Handle "#endif !defined" conditionals 2011-01-30 17:33:44 -06:00
Raphael Geissert
b944168bdc Check for cpp conditionals where a define is already guaranteed 2011-01-30 12:47:17 -06: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
Raphael Geissert
49848fd752 Remove duplicated defines
After simplifying define(A) conditionals, the final list of
configurations could end up containing duplicate items.

Ticket #1468
2011-01-30 02:13:32 -06:00
Robert Reif
09998d9e18 Memory leaks: less conservative checking of classes. ticket: #2517 2011-01-30 08:38:20 +01:00
Daniel Marjamäki
49fc53165c Tokenizer: remove some unhandled macros in the global scope. ticket: #2523 2011-01-30 08:34:58 +01:00
Kimmo Varis
b9a0e10b9a Several fixes to cmd line tests.
There were several tests handling two parameters as one string.
Eg. "-I path" which doesn't work correctly. Fixed these
problematic tests.
2011-01-29 19:18:47 +02:00
Kimmo Varis
d334a02801 Make --exitcode-suppressions option consistent.
The --exitcode-suppressions option was inconsistent with other
long options by taking the filename as separate argument. Now
it expects format --exitcode-suppressions=filename.txt like
other long options.

Ticket: #1837 (--suppresions file.txt inconsistent)
2011-01-29 19:18:47 +02:00
Daniel Marjamäki
a299411a82 Tokenizer: Better simplifications of static constants 2011-01-29 16:14:09 +01:00
Kimmo Varis
081e364298 Rename --suppressions-list CLI option.
The option --suppressions-list was inconsistent with other options
so renaming it to --suppressions-list.

Ticket: #1837 (--suppresions file.txt inconsistent)
2011-01-28 13:26:43 +02:00
Daniel Marjamäki
83625d8055 Fixed #2505 (Check processing of a preprocessor macro 'FREE') 2011-01-28 09:19:30 +01:00