Commit Graph

2051 Commits

Author SHA1 Message Date
Daniel Marjamäki a6d696bf40 Fixed #504 (false positive: null pointer dereference) 2009-07-25 20:36:02 +02:00
Daniel Marjamäki 321106c39e speedup of CheckOther::postIncrement 2009-07-25 19:36:57 +02:00
Daniel Marjamäki b172d62cae Added more tests to the TestPreprocessor::match_cfg_def (#505) 2009-07-25 17:04:13 +02:00
Daniel Marjamäki 2544bd8805 astyle formatting 2009-07-25 16:27:18 +02:00
Daniel Marjamäki f877cd2db1 Preprocessor: Added todo test case for better evaluation of #if conditions 2009-07-25 16:22:42 +02:00
Daniel Marjamäki dacaff824c Fixed #501 (Preprocessor should read open configurations that are defined within the file) 2009-07-25 13:58:34 +02:00
Slava Semushin 5f4c83a25e src/checkother.cpp: simplify condition a bit.
No functional change.
2009-07-25 18:23:13 +07:00
Slava Semushin 8643936e0c Fixed ticket #500 (Tokenizer: simplify the "(p != NULL)" conditions)
Also teach simplifyIfNot() to handle variables like Foo::var.

https://sourceforge.net/apps/trac/cppcheck/ticket/500
2009-07-25 18:23:03 +07:00
Slava Semushin 88d7c598e3 test/testtokenize.cpp: use tokenizeAndStringify() function.
Instead of self-written code.

No functional change.
2009-07-25 16:41:16 +07:00
booga 9fa8c0ee9c astyle FTW (should have read about that sooner) 2009-07-24 19:23:30 -04:00
booga 52e2e775b2 Fix #476 STL Container checks.
Fix #473 Add post increment check for STL objects and Classes.
2009-07-24 18:36:15 -04:00
Daniel Marjamäki 9136d8cf80 Tokenizer: simplify return statements - remove redundant parantheses 2009-07-24 21:55:35 +02:00
Daniel Marjamäki 6bb85703f6 memory leaks: fixed false positive for struct members - better handling of if/else 2009-07-24 09:05:40 +02:00
Daniel Marjamäki 73c028bdb7 memory leaks: added a todo test case for struct members when using if-else 2009-07-23 22:29:31 +02:00
Daniel Marjamäki 5b81c92a14 null pointers: fixed false positives when checking if pointer is null at many locations (#485) 2009-07-23 19:59:29 +02:00
Daniel Marjamäki 06c8ff9d0d null pointers: fixed false positives (#49) 2009-07-23 19:02:14 +02:00
Daniel Marjamäki 565ac2fca6 Fixed #493 (Memory leak: False positive when using the exit(0)) 2009-07-23 16:30:30 +02:00
Daniel Marjamäki d0f1d885ed null pointers: dereferencing a pointer and then checking if it's null (#49) 2009-07-23 14:13:46 +02:00
Daniel Marjamäki 024778d6eb tokenizer: simplify '?:' better when the condition is always true 2009-07-23 10:12:02 +02:00
Daniel Marjamäki 9b2dd8c7eb Preprocessor: Better evaluation of conditions such as '#if defined A || defined B' (#469) 2009-07-22 20:11:27 +02:00
Daniel Marjamäki 62f681094f tokenizer: added todo for simplifying '(true?x:y)' => '(x)' 2009-07-22 19:39:31 +02:00
Daniel Marjamäki e36994f54b astyle formatting 2009-07-22 18:48:42 +02:00
Daniel Marjamäki 6fecd858e3 Fixed #469 (Preprocessor should read open configurations that are defined within the file) 2009-07-22 18:47:50 +02:00
Daniel Marjamäki 1d514e1afe Fixed #497 (Templates are not expanded correctly) 2009-07-22 13:29:42 +02:00
Daniel Marjamäki 3243933c90 Fixed #494 (False positives of checking leaks struct members)
Better handling of function calls
2009-07-22 08:30:51 +02:00
Daniel Marjamäki ba36c9426b null pointers: better checking when dereferencing pointer and then checking if it is null (#485) 2009-07-21 17:00:11 +02:00
Daniel Marjamäki 6f646246ee dereferencing deallocated memory: it is ok to take the address to deallocated memory but it is not ok to dereference the address 2009-07-21 13:04:13 +02:00
Daniel Marjamäki 45f8560537 invalid pointer usage: broke out CheckOther::invalidPointer from the CheckOther::nullPointer (#485) 2009-07-21 12:09:58 +02:00
Daniel Marjamäki ce595dd5c7 Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-21 07:41:43 +02:00
Reijo Tomperi d2278b5ce0 Fix some of the issues from #478 (Warnings in Visual Studio build with -W4)
http://sourceforge.net/apps/trac/cppcheck/ticket/478
2009-07-20 23:24:23 +03:00
Reijo Tomperi 973bb164ea Fix ticket #486 (C-style pointer casting misses const pointers)
http://sourceforge.net/apps/trac/cppcheck/ticket/486
2009-07-20 22:52:27 +03:00
Daniel Marjamäki 0e208eb52f null pointer dereferencing: fixed another false positive (#485) 2009-07-20 19:59:55 +02:00
Daniel Marjamäki 05a1c50ff2 null pointer dereferencing: removed a few false positives in the new check that I added (#485) 2009-07-20 19:30:33 +02:00
Daniel Marjamäki 324f12a103 fix bug in previous commit that fixed #485 2009-07-20 19:10:33 +02:00
Daniel Marjamäki b7ba49114c Fixed #485 (detect when code is checking for null after dereferencing) 2009-07-20 18:53:41 +02:00
Daniel Marjamäki f0afdf3582 preprocessor: Fixed hanging in Preprocessor::expandMacros when trying to replace all '__VA_ARGS__' with '__VA_ARGS__' 2009-07-20 15:42:40 +02:00
Daniel Marjamäki 74699cab66 memory leak for struct member: made the checking more sensitive. Skip bail-out execution paths were the member is properly deallocated 2009-07-20 14:39:24 +02:00
Daniel Marjamäki ddaea3244d memleak: implemented simple checking for leaking struct members 2009-07-19 16:51:31 +02:00
Slava Semushin d961e4b5c1 test/testrunner.cpp: fixed exit code when count of fails tests equals to 256.
When 256 tests fails return code was 0 and it was wrong. Now exit code
may be only 0 or 1 and not show how many tests fails.

Thanks to aggro80@ for pointing to this!
2009-07-19 03:12:55 +07:00
Daniel Marjamäki ffac9281c4 astyle formatting 2009-07-18 20:35:22 +02:00
Slava Semushin 2ba0897ecb src/checkmemoryleak.cpp: added fchmod() function to white list. 2009-07-18 23:48:48 +07:00
Slava Semushin d3490abd64 Finally fixed ticket #284 (style check: redundant condition improvement)
http://sourceforge.net/apps/trac/cppcheck/ticket/284
2009-07-18 21:42:08 +07:00
Slava Semushin d04eeb4fd4 Fixed ticket #481 (testrunner should exit with non-zero status if one of tests fails)
http://sourceforge.net/apps/trac/cppcheck/ticket/481
2009-07-18 19:08:10 +07:00
Slava Semushin a0a526a205 Fixed ticket #464 (resource leak not detected when getc is used on the file handle)
http://sourceforge.net/apps/trac/cppcheck/ticket/464
2009-07-18 18:32:55 +07:00
Slava Semushin 53c120c701 Fixed ticket #479 (varId not assigned to reference to standart container)
http://sourceforge.net/apps/trac/cppcheck/ticket/479
2009-07-18 17:41:46 +07:00
Kimmo Varis 69cbacfc87 Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-18 13:37:21 +03:00
Kimmo Varis d1eb7e6558 GUI: clarify compiling instructions a bit. 2009-07-18 13:34:00 +03:00
Kimmo Varis 861774575d Enable more warnings in QMake-generated makefiles.
Use same warning levels for GCC than in original makefile. Use W4 level for Visual Studio.
2009-07-18 13:10:24 +03:00
Slava Semushin aab06eaeab Fixed ticket #477 (Bug in Token::Match() during process TestStl::pushback3)
http://sourceforge.net/apps/trac/cppcheck/ticket/477
2009-07-18 17:06:51 +07:00
Kimmo Varis 4622f9891c Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-18 11:26:15 +03:00