Commit Graph

1030 Commits

Author SHA1 Message Date
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 f3fbdc96e1 Fixed #1788 (Tokenizer: template destructor is lost) 2010-06-12 08:32:05 +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
Robert Reif 00dcec47ac Variable usage: read variable when using syntax '..=*(p);' 2010-06-08 18:26:14 +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
Daniel Marjamäki a9196e8710 Memory leaks: Added allocation function 'g_strdup_printf' 2010-06-06 11:09:19 +02:00
Daniel Marjamäki 68ad8219ed Fixed #1722 (Member variable initialized in call to base class constructor) 2010-06-06 08:29:35 +02:00
Martin Ettl f75ca79849 applied patch from php-coder from ticket 1724; removed TODO_TESTCASES; 2010-06-05 19:49:49 +02:00
Daniel Marjamäki 1de6e94947 Code coverage: Removed unused code 2010-06-05 11:25:47 +02:00
Daniel Marjamäki 07e00d57d9 Fixed #1725 (segfault in ExecutionPath::bailOutVar (probably caused by #1721 fix)) 2010-06-05 09:45:35 +02:00
Leandro Lisboa Penz 4ac7da7d51 Fixed #73 (memory leaks not found when calling a function that returns allocated memory through a parameter) 2010-06-04 20:58:50 -03:00
Zachary Blair 2645e96783 Applied review suggestions for Ticket #568 2010-06-03 22:42:54 -07:00
Daniel Marjamäki b11e23eb08 Fixed #1721 (False negative: uninitialized variable in switch block) 2010-06-03 20:02:58 +02:00
Robert Reif 4c4844b722 Fixed #1723 (Variable assigned value which is never used but is thrown) 2010-06-03 07:05:57 +02:00
Daniel Marjamäki 09e02b9f9f updated --help output. The --enable is used to enable additional checks. 2010-06-02 21:34:03 +02:00
Daniel Marjamäki cb43168d81 Fixed #1720 (segmentation fault of cppcheck) 2010-06-02 18:10:32 +02:00
Daniel Marjamäki 5789eb116d astyle formatting 2010-06-02 18:09:25 +02:00
Daniel Marjamäki 8ead23fc91 CheckOther::nullConstantDereference: Fixed cppcheck warning message - tok may become null 2010-06-02 18:06:37 +02:00
Daniel Marjamäki 28ad69e4b3 Refactoring of CheckOther::nullConstantDereference 2010-06-02 17:53:45 +02:00
Zachary Blair 33b4254d33 Fixed #568 (string functions with command line arguments may overflow buffer) 2010-06-01 22:41:07 -07:00
Daniel Marjamäki 45821b3871 Fixed #1719 (False negative: memory leak (fgets in condition)) 2010-05-31 18:20:34 +02:00
Daniel Marjamäki 9b1ed1112b Memory leaks: Fixed bug in CheckMemoryLeak::functionReturnType 2010-05-30 20:30:08 +02:00
Daniel Marjamäki 08b6e6ee09 Fixed #1717 (False positive: Resource leak with while) 2010-05-30 13:15:15 +02:00
Daniel Marjamäki 83c62eca9c Tokenizer: simplify loops that continue while errno is EINTR 2010-05-30 12:49:39 +02:00
firewave 62093d764d Fixed Visual Studio 2010 warning 2010-05-30 10:44:03 +02:00
Daniel Marjamäki 37ae4692bb Uninitialized variables: fixed false negative when using uninitialized variable inside malloc call 2010-05-30 10:30:51 +02:00
Daniel Marjamäki 1ec49430e3 Uninitialized variables: better handling when uninitialized variables are used in function calls 2010-05-30 09:31:10 +02:00
Daniel Marjamäki ab41879246 ExecutionPath: Better handling of 'FOREACH (..) {}' 2010-05-30 09:00:18 +02:00
Daniel Marjamäki f41334e58a ExecutionPath: better handling of 'FOREACH(..){..}' 2010-05-30 08:26:44 +02:00
Daniel Marjamäki d3ed1c8960 Refactoring uninitialized variables (checking variable declarations) 2010-05-30 08:02:39 +02:00
Daniel Marjamäki 406cbda563 Uninitialized variables: better handling of struct variables 2010-05-30 07:55:11 +02:00
Daniel Marjamäki 46b5e4e79a Fixed #1716 (Wrong reporting of leak with close() in a while loop condition) 2010-05-29 22:20:10 +02:00
Daniel Marjamäki 0c6352a826 Memory leaks: small fixes. add checking of 'g_fopen'. don't let 'fclose' calls be interpreted as 'callfunc' 2010-05-29 21:56:18 +02:00
Daniel Marjamäki 495dfde32c Fixed #1716 (Wrong reporting of leak with close() in a while loop condition) 2010-05-29 21:11:59 +02:00
Daniel Marjamäki 24703418bd Fixed #1715 (switch with fallthrough and 'return' confuses cppcheck) 2010-05-29 20:55:09 +02:00
Daniel Marjamäki d09e1df0d7 Fixed #1714 (Wrong precedence for shift operators when simplifying calculations?) 2010-05-29 20:27:08 +02:00
Daniel Marjamäki b702b8542d Memory leaks: enabled the leaks checking when members are not deallocated in the destructor. This checking was previously an --all check so there could be false positives. 2010-05-29 19:29:59 +02:00
Daniel Marjamäki 7601089bee astyle formatting 2010-05-29 11:19:56 +02:00
Daniel Marjamäki 82f030df2c the virtual destructor error message needs to be restricted. marked the checking as inconclusive for now. 2010-05-29 11:19:28 +02:00
Zachary Blair fe1fa4022d Merge branch 'master' of github.com:danmar/cppcheck 2010-05-28 22:53:54 -07:00
Robert Reif 1a25183e8f Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-29 07:52:06 +02:00
Zachary Blair 59086fa599 Fixed #818 (Detect sprintf buffer overrun with struct members) 2010-05-28 22:51:28 -07:00
Robert Reif 3fb0260ef1 Fixed #1713 (remove Microsoft variants of inline) 2010-05-29 07:43:58 +02:00
Robert Reif 26a7d29760 Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-28 06:55:54 +02:00
Daniel Marjamäki d3c20cac81 Fixed #1712 (False negative: dereferencing uninitialized pointer) 2010-05-27 19:00:52 +02:00
Robert Reif dc34a1b3ff Fixed #1711 (Wrong typedef name shown when struct declared with __attribute__) 2010-05-27 18:15:42 +02:00
Robert Reif 8881a0c361 Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-27 07:00:33 +02:00
Robert Reif 176b41caa5 Fixed #1709 (char buffer that is only accessed with pointers is marker not assigned) 2010-05-26 19:22:35 +02:00
Daniel Marjamäki d23f63c805 astyle formatting 2010-05-26 19:21:34 +02:00
Daniel Marjamäki 88e9a4ade6 Fixed #1704 (false negative: null pointer dereference) 2010-05-26 19:16:42 +02:00
Zachary Blair 619cfbc56f Fixed #168 (buffer overflow: not enough room for the null terminator) 2010-05-26 01:56:34 -07:00
Robert Reif 019e1f9dfe Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-25 20:43:44 +02:00
Robert Reif 4306082fcf Fixed #1708 (False positive for const) 2010-05-25 06:55:49 +02:00
Daniel Marjamäki 5692e7a6f6 Fixed #1707 (false positive: Memory leak) 2010-05-24 19:28:27 +02:00
Daniel Marjamäki c465d824b7 Removed TODO 2010-05-24 07:32:33 +02:00
Daniel Marjamäki 78255fdfc5 Tokenizer: Removed the Tokenizer::simplifyNamespaces. Ticket: #1700 2010-05-23 13:51:41 +02:00
Robert Reif b20cf06b66 Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-23 10:46:39 +02:00
Robert Reif 048733a15e false positive: Variable is assigned a value that is never used 2010-05-23 10:41:05 +02:00
Daniel Marjamäki 8f76aea6ed 2 pass checking: broke out Cppcheck::analyseFile. To be used for tests 2010-05-21 21:06:11 +02:00
Daniel Marjamäki 75c9355e9a Added some multipass checking for the uninitialized variables. It is still experimental. You can activate it with the '--test-2-pass' switch. Some more refactorings are needed to make it truly usable, the main thing is to make it thread safe. 2010-05-21 19:35:18 +02:00
Daniel Marjamäki 4633979ff7 fixed gcc compiler warnings (comparing float values) 2010-05-21 12:28:13 +02:00
Daniel Marjamäki 89ec49508d Fixed gcc compiler warning 2010-05-21 12:13:05 +02:00
Robert Reif a8921afcd7 Fixed #1698 (Add define support to GUI) 2010-05-21 09:49:57 +02:00
Daniel Marjamäki 8d2e4bc553 Tokenizer: give dead pointer a value 2010-05-21 08:26:53 +02:00
Robert Reif 78614b8dc1 Fixed #1699 (False positive: The function '...' can be const) 2010-05-20 17:45:10 +02:00
Robert Reif 5dfbb38dc9 #1697 (false positive: The function can be const) 2010-05-20 06:52:59 +02:00
Daniel Marjamäki c31accc52a Fixed #1695 (Ticket #1614 is broken using latest from git) 2010-05-19 19:23:09 +02:00
Daniel Marjamäki 6815f4e941 printchecks: better explanation of its purpose. I call it from gdb when I debug ExecutionPaths. 2010-05-18 20:58:11 +02:00
Daniel Marjamäki 1792395654 astyle formatting 2010-05-18 20:08:27 +02:00
Daniel Marjamäki f87eb774eb Fixed #1646 (False positive: array access after return cannot have default loop value) 2010-05-18 19:55:23 +02:00
firewave 2bced1d90c Avoid some Visual Studio warnings 2010-05-18 19:19:15 +02:00
Robert Reif 41c43c1790 Fixed #1691 (False positive: Function parameter 'x' is passed by value. It could be passed by reference instead.) 2010-05-18 18:20:11 +02:00
Zachary Blair 1539c0b3d2 Fixed #1649 (add a warning for potential memory leaks when using realloc) 2010-05-17 22:46:48 -07:00
Robert Reif 0d7474042a Fixed #1685 (segmentation fault of cppcheck) 2010-05-18 07:11:23 +02:00
Robert Reif 9dfbd3946a Fixed #1673 (Tokenizer::simplifyTypedef causes segfault for boost library) 2010-05-17 19:58:27 +02:00
Daniel Marjamäki f8442391af astyle formatting 2010-05-17 19:51:35 +02:00
Daniel Marjamäki 453adb4ea4 Tokenizer: it is bad to do: 'tok->previous()->deleteThis()' 2010-05-17 19:50:36 +02:00
Monika Lukow 71e5c56bf9 Fixed #1418 (false negative: buffer access out of bounds) 2010-05-16 23:53:42 +02:00
Erik Lax 20289b1f5b Fixed #1683 (false positive: The function can be const) 2010-05-16 20:26:32 +02:00
Daniel Marjamäki 56d176e1ce Fixed #1684 (false positive: buffer access out of bounds when using extern variable declaration) 2010-05-16 20:21:22 +02:00
Daniel Marjamäki 4c6858fa9c Refactoring: Removed 'possibleError' 2010-05-16 19:57:41 +02:00
Daniel Marjamäki d0e122079f Refactoring: Removed possibleError messages from CheckMemoryLeaks 2010-05-16 19:55:16 +02:00
Erik Lax 19aaa32a99 Fixed #1688 (Tokenizer::simplifyKnownVariables and pointer assignments) 2010-05-16 19:38:44 +02:00
Daniel Marjamäki 01034cd48d Refactoring: Removed 'possible error' message about cin 2010-05-16 19:09:36 +02:00
Daniel Marjamäki 26fab24de4 Refactoring: Removed some inconclusive checking in CheckBufferOverrun 2010-05-16 15:30:39 +02:00
Daniel Marjamäki 6edb2e77b4 Refactoring: Removed Severity::possibleStyle 2010-05-16 14:43:42 +02:00
Daniel Marjamki 5fe2a56b41 doc: updated docs about -D command line flag 2010-05-16 08:48:03 +02:00
Daniel Marjamki 14b27f97fa Fixed #1212 (Allow giving used defines in command line) 2010-05-16 07:38:29 +02:00
Daniel Marjamki d7b117402c Code cleanup: Removed autodealloc handling 2010-05-16 07:15:31 +02:00
Daniel Marjamki 8e3c39ae5b Fixed #1678 (false positive: Member variable not initialized in the constructor, for arrays of undefined type) 2010-05-15 20:24:11 +02:00
Erik Lax c0149d3cd1 Fixed #1679 (Bad iterators checks fails to detect bugs with indent levels) 2010-05-15 20:00:41 +02:00
Erik Lax 0510d9a2b0 Fixed #1680 (Bad iterators checks fail to detect invalidation of iterator for deletion by value) 2010-05-15 19:46:42 +02:00
Daniel Marjamki 70d20ac544 Fixed #1681 (false negative: memory leak in operator =) 2010-05-15 19:40:32 +02:00
Daniel Marjamki 972046c4bd Added test CheckOther::sizeofsizeof. Inspired by #1682 2010-05-15 14:06:45 +02:00
Daniel Marjamki 85afa86da3 astyle formatting 2010-05-14 18:40:37 +02:00
Daniel Marjamki 8b1ffefd74 Fixed #1682 (Internal error) 2010-05-14 18:40:15 +02:00
Konrad Windszus c39f80d361 Ticket #1318: Make sure error ids are unique 2010-05-13 22:14:29 +02:00
Robert Reif f8cceface5 Fixed #1677 (False positive: (style) Variable 'xxx' is assigned a value that is never used) 2010-05-13 13:59:41 +02:00
Martin Ettl 1382832bd0 mathlib:isInt() now handles calles of 'u' and 'l' correctly; testcases added 2010-05-12 23:49:09 +02:00
Robert Reif 963108d957 Fixed #1671 (simplifyTypedef: support for more typedefs) 2010-05-11 21:41:33 +02:00
Daniel Marjamäki 84c3ec9c4c Fixed #1669 (Still seeing 'possible style' warnings in 1.43) 2010-05-10 21:22:59 +02:00
Daniel Marjamäki 5d01047ae4 Fixed #1665 ('If you see this, there is a bug': Token::Match('%var% ( %varid% [,)]', 0)) 2010-05-10 18:11:02 +02:00
Robert Reif a390f3c8f4 Better handling of function pointer typedef 2010-05-10 17:50:40 +02:00
Robert Reif ac7515cdcc Fixed #1666 (simplifyTypedef: add support for typedefs of functions) 2010-05-10 07:12:06 +02:00
Daniel Marjamäki d7118c4d36 Fixed #1648 (mismatch allocate and deallocate calls.) 2010-05-09 13:46:13 +02:00
Daniel Marjamäki 7c52c8683d Fixed #1662 (false positive: Data is allocated but not initialized, when using sprintf) 2010-05-09 07:48:52 +02:00
Robert Reif be35b72c7e Fixed #1660 (false positive: Variable is assigned a value that is never used, when using cast) 2010-05-09 07:15:40 +02:00
Daniel Marjamäki 8971d697b2 Fixed #1656 (dangerous usage of erase not detected: for (; it != it2; ++it) ints.erase(it);) 2010-05-08 20:11:15 +02:00
Daniel Marjamäki 2901434773 Fixed #1658 (false negative: uninitialized pointer usage) 2010-05-08 19:23:46 +02:00
Daniel Marjamäki cdb6915a5b cli help: show the flags in alphabetical order 2010-05-08 12:45:38 +02:00
Daniel Marjamäki cbea8ceed0 Updated version to 1.43 2010-05-08 12:41:06 +02:00
Daniel Marjamäki 4e84ec0ff5 refactoring: spell checking comments 2010-05-08 10:39:45 +02:00
Daniel Marjamäki bd22a18dc1 Refactoring: Changed 'possible style' to 'style' 2010-05-08 09:49:01 +02:00
Daniel Marjamäki d19dd2c61d Fixed #1654 (False positive: Memory leak with: ( delete ( p ) , ( p ) = 0 );) 2010-05-07 18:37:50 +02:00
Zachary Blair 21b7eb61f5 Fixed #959: (new check: wrong usage of fflush()) Simplified and set severity to error 2010-05-06 23:08:10 -07:00
Daniel Marjamäki c8c5f95721 Fixed #1651 (Tokenizer::setVarId wrong handling of return statement) 2010-05-06 18:40:52 +02:00
Daniel Marjamäki af4c4cef34 Fixed #1646 (False positive: array access after return cannot have default loop value) 2010-05-05 18:29:56 +02:00
Robert Reif 4c95264d29 Fixed #1647 (False positive: buffer is not assigned value (assigned through alias)) 2010-05-05 17:31:07 +02:00
Daniel Marjamäki 612be2557b Fixed #1646 (False positive: array access after return cannot have default loop value) 2010-05-04 20:02:47 +02:00
Robert Reif 7ce70777a4 Fixed #1643 (Variable usage (pointer is assigned but never used)) 2010-05-04 17:28:03 +02:00
Robert Reif eb276346c5 Fixed #1639 (False positive: unused variable value (pointer aliasing)) 2010-05-04 17:26:09 +02:00
Zachary Blair 707d27f3d8 Fixed #959 (new check: wrong usage of fflush()) 2010-05-03 23:14:45 -07:00
Daniel Marjamäki 804b2a0952 Fixed #1642 (Tokenizer::simplifyKnownVariables: simplify after loop) 2010-05-02 14:41:21 +02:00
Daniel Marjamäki 0415560912 refactoring: changed the severity for strncatUsage from possibleError to style 2010-05-02 09:54:08 +02:00
Daniel Marjamäki 883d462553 refactoring: Use style severity instead of possible error for the 'The size argument is given as a char constant' 2010-05-02 09:16:45 +02:00
Daniel Marjamäki 136b84eaf5 STL: added testcase for 'if (str.find(%any%)) ..' 2010-05-01 21:56:39 +02:00
Daniel Marjamäki ae576be088 refactoring: enable the 'suspicious pointer subtraction' checking 2010-05-01 21:43:47 +02:00
Robert Reif 6eb16e0f16 Fixed #1640 (False negative: Unused value (variable is assigned but never read)) 2010-05-01 21:15:14 +02:00
Daniel Marjamäki 58e26ab1fc Fixed Cppcheck warning about possible null pointer dereference 2010-05-01 11:55:26 +02:00
Slava Semushin f50d182750 Fixed #1574 (chain assignments could be simplified)
http://sourceforge.net/apps/trac/cppcheck/ticket/1574
2010-05-01 15:28:35 +07:00
Daniel Marjamäki 080374dc04 Fixed #1638 (Tokenizer::simplifyKnownVariables: removing variable declaration) 2010-05-01 10:09:53 +02:00
Robert Reif 4014bd234f Unit testing: Improved test coverage for variable usage checking 2010-05-01 09:26:47 +02:00
Robert Reif 1fa1ff8d14 Fixed #1636 (Fix false positive with strncpy termination check) 2010-04-30 21:36:48 +02:00
Robert Reif 5738f34872 Fixed #1622 (False positive: buf is not assigned a value (pointer aliasing)) 2010-04-30 18:11:51 +02:00
Eric Sesterhenn 344b6bf434 Fixed #1636 (Fix false positive with strncpy termination check) 2010-04-30 18:08:32 +02:00
Eric Sesterhenn b261e5df25 Fixed #1634 (Null character not correctly tokenized) 2010-04-29 18:30:23 +02:00
Robert Reif c79b9a8aac Fixed #1631 (Tokenizer: remove register keyword) 2010-04-29 07:17:38 +02:00
Robert Reif 70d475f8c2 Fixed #1622 (False positive: buf is not assigned a value (pointer aliasing)) 2010-04-29 07:10:50 +02:00
Daniel Marjamäki cccccff96f Fixed #1629 (False negative: null pointer derefence not detected 'c[0] = 0') 2010-04-28 22:07:39 +02:00
Daniel Marjamäki 2666aad207 Fixed #1632 (false positive: unintialized variable) 2010-04-28 21:33:11 +02:00
Daniel Marjamäki d3b5c30c6c Fixed #1628 (false negative: memory leak when using redundant braces) 2010-04-27 20:43:31 +02:00
Robert Reif f0018100e1 Variable usage: Use variable id instead of variable name to identify variable 2010-04-27 05:05:32 +02:00
Daniel Marjamäki 9430089532 Fixed #1626 ('Unusual pointer arithmetic' false positive) 2010-04-26 21:43:01 +02:00
Daniel Marjamäki 0444ff5298 Fixed #1627 (###### If you see this, there is a bug ###### - Token::Match('%varid% [ %num% ]', 0)) 2010-04-26 18:52:40 +02:00