Commit Graph

73 Commits

Author SHA1 Message Date
Daniel Marjamäki 7f2ca357b0 Fixed #673 (False positive: null pointer dereference when dynamic cast is used) 2009-09-19 10:54:10 +02:00
Daniel Marjamäki e4291a5966 Fixed #676 (The scope of variable can actually not be limited) 2009-09-17 21:05:12 +02:00
Reijo Tomperi 8ab26e85cf Don't warn about division by zero if zero if floating point number.
Fix bug from mathlib isInt() and add test case from which few are false positives
2009-09-01 22:06:46 +03:00
Reijo Tomperi 0d468d97c7 Fix #630 (Division by zero check only looks at first character of divisor)
http://sourceforge.net/apps/trac/cppcheck/ticket/630
Thanks to liam_routt for finding this and providing fix for it.
2009-09-01 17:00:26 +03:00
Reijo Tomperi 6fb44e733b Fix ticket #612 (Division by zero not detected when zero has type suffix)
http://sourceforge.net/apps/trac/cppcheck/ticket/612
2009-08-30 22:02:09 +03:00
Daniel Marjamäki 5d2c409e46 Fixed #623 (False positive: possible null pointer dereference when using the ?: operator) 2009-08-28 08:48:37 +02:00
Daniel Marjamäki c25e1963b1 Fixed #498 (Tokenizer: simplify 'goto') 2009-08-24 23:10:12 +02:00
Slava Semushin e6120a5725 Fixed #581 (Wrong usage of div-function)
http://sourceforge.net/apps/trac/cppcheck/ticket/581
2009-08-23 10:37:09 +07:00
Slava Semushin ec050d2563 TestOther::varScope5: fixed syntax error in test case.
Testrunner complains about "Unlogged error at Tokenizer::syntaxError"
since 74bbe945f6 commit.
2009-08-22 21:29:09 +07:00
Daniel Marjamäki 439ff8b144 Fixed #599 (False positive: null pointer dereference) 2009-08-21 12:42:40 +02:00
Slava Semushin 74bbe945f6 Fixed #272 ("The scope of the variable XXX can be limited" not detected when variable is initilialized during declaration)
http://sourceforge.net/apps/trac/cppcheck/ticket/272
2009-08-17 02:12:57 +07:00
Daniel Marjamäki ad4ea01750 Fixed #583 (False positive: the nullpointer check doesn't handle goto properly) 2009-08-12 18:54:52 +02:00
Slava Semushin 4c32057180 Fixed ticket #541 (Wrong testcases produce unlogged error at Tokenizer::syntaxError)
http://sourceforge.net/apps/trac/cppcheck/ticket/541
2009-08-12 02:06:41 +07:00
Daniel Marjamäki e7feac506c Refactoring: updated the nullPointer message so it contains the name of the pointer 2009-08-11 17:18:01 +02:00
Daniel Marjamäki e6713e9774 null pointers: fixed a false positive 2009-08-01 11:30:37 +02:00
Daniel Marjamäki 2d9e4e1a73 null pointers: detect when there are possible null pointer dereferencing when looping through a linked list both in inner and outer loops at the same time 2009-07-31 10:49:43 +02:00
Daniel Marjamäki 228e926654 null pointers: Added a todo testcase 2009-07-30 21:57:23 +02:00
Daniel Marjamäki 4e66dc105e null pointers: Fixed false positive when 'do' are used 2009-07-29 11:17:22 +02:00
Daniel Marjamäki a6d696bf40 Fixed #504 (false positive: null pointer dereference) 2009-07-25 20:36:02 +02: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 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 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 e36994f54b astyle formatting 2009-07-22 18:48:42 +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 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 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 b7ba49114c Fixed #485 (detect when code is checking for null after dereferencing) 2009-07-20 18:53:41 +02: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
Reijo Tomperi 8b0e481d46 Refactoring: Rename member functions to follow naming guidelines. 2009-07-05 23:16:43 +03:00
Daniel Marjamäki 12c9f09780 Fixed #420 (WarningOldStylePointerCast() needs a test case) 2009-06-19 12:01:27 +02:00
Reijo Tomperi b7171c3cd2 Fix ticket #413 (false positive: C-style pointer casting for pure virtual function)
http://sourceforge.net/apps/trac/cppcheck/ticket/413
2009-06-18 23:26:21 +03:00
Daniel Marjamäki 35b6b2588e Fixed ticket #374 (False positive: The scope of variable can be limited)
A few refactorings and fixes were made
2009-06-12 16:17:51 +02:00
Daniel Marjamäki a71d260308 Refactoring: Moved CheckOther::returnPointerToLocalVariable to CheckAutoVariables 2009-06-09 19:45:58 +02:00
Reijo Tomperi 9cd5558f5e Fix ticket #364 (false positive:: division by zero)
http://apps.sourceforge.net/trac/cppcheck/ticket/364
2009-06-06 00:33:13 +03:00
Slava Semushin 52a8368b02 Strip redundant std::string usage from tests.
Second round: handle empty strings.

Done by command:
git grep -l ASSERT_EQUALS | xargs sed -i 's|ASSERT_EQUALS(std::string(\(".*"\)),|ASSERT_EQUALS(\1,|'

Should be no functional change.
2009-06-05 07:43:55 +07:00
Slava Semushin e5c0383594 Strip redundant std::string usage from tests.
Done by command:
git grep -l ASSERT_EQUALS | xargs sed -i 's|ASSERT_EQUALS(std::string(\(".\+"\)),|ASSERT_EQUALS(\1,|'

Should be no functional change.
2009-06-01 02:50:25 +07:00
Reijo Tomperi 58eda6e978 Fix ticket #325 (Replace developer names in source files with AUTHORS file)
http://apps.sourceforge.net/trac/cppcheck/ticket/325
2009-05-30 08:48:12 +03:00
Daniel Marjamäki 650d58e3de Fix for ticket 337 ('scope can be limited' false positive with variables referenced by pointers) 2009-05-27 19:38:26 +02:00
Slava Semushin f5300ae56c Part of fix for ticket #284 (style check: redundant condition improvement)
Fixed case "if (p) delete [] p;" and also added test case for it.

http://apps.sourceforge.net/trac/cppcheck/ticket/284
2009-05-24 00:32:53 +07:00
Slava Semushin bc62472a18 Part of fix for ticket #284 (style check: redundant condition improvement)
Fixed case "if (p != NULL) delete p;" and also added test case for it.

http://apps.sourceforge.net/trac/cppcheck/ticket/284
2009-05-24 00:30:27 +07:00
Daniel Marjamäki 1ae24066fe null pointer dereferencing: check that its a pointer that is dereferenced to avoid false positives when using classes that behave almost like pointers (#295) 2009-05-10 08:43:16 +02:00
Daniel Marjamäki ca8f25fced return pointer to local array: fixed false positive when return value is converted to for instance a std::string (#255) 2009-04-19 16:47:54 +02:00
Daniel Marjamäki 263c5b9e5a division with zero => division by zero 2009-03-29 20:27:10 +02:00
Daniel Marjamäki d7aee72fcd zero division: it's an error 2009-03-29 18:47:05 +02:00
Daniel Marjamäki 022dbc651e removed TestOther::zeroDiv3 - it is not valid 2009-03-28 08:02:15 +01:00