Commit Graph

40 Commits

Author SHA1 Message Date
PKEuS 8f79dc3ff8 Cleaned up includes and forward declarations in checkers:
- Removed definitely unnecessary forward declarations (e.g. "class Token"; token.h is already included by check.h, so a definition is unnecessary)
 - Removed unused includes
2014-05-24 12:50:03 +02:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki be5c00d215 Uninitialized variables: check function arguments 2013-12-09 15:58:42 +01:00
Daniel Marjamäki 14a00046a3 Fixed #5207 (Struct uninitialized members useage is not giving error (malloc).) 2013-12-04 20:32:20 +01:00
Ettl Martin 9ab6655d85 Fixed #5007 (Same include guard naming) 2013-09-04 20:59:49 +02:00
PKEuS a9a5dc0354 Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
Alexander Mai 7a324cef25 Fixed various Cppcheck inconclusive warnings 2013-07-30 12:52:27 +02:00
Daniel Marjamäki 2a1af1acda CheckUninitVar: Assertion for '} while (' after 'do {..' in debug builds. Bail out in release builds to avoid segfaults. 2013-07-28 12:41:38 +02:00
Daniel Marjamäki ba23b65179 Fixed #4885 (FP Uninitialized variable when using comma) 2013-06-29 09:33:51 +02:00
PKEuS 292e52364c Refactorizations:
- Removed empty implementation of CheckUninitVar::runChecks()
- Avoided unnecessary string copying
2013-03-12 08:11:18 -07:00
Daniel Marjamäki 442db6cdf9 Fixed #4569 (False Positive: Uninitialised variable) 2013-02-11 18:31:14 +01:00
Daniel Marjamki 9c8d600ca9 Uninitialized variables: Refactor CheckUninitVar::isVariableUsage 2013-02-02 15:21:54 +01:00
Robert Reif 859793731d SymbolDatabase: Refactor findFunction handling. Ticket: #4494 2013-01-28 06:47:48 +01:00
Daniel Marjamäki c235737b6c Uninitialized variables: improved checking of loops 2013-01-24 19:41:15 +01:00
Daniel Marjamki f1c195e652 Fixed #3506 (false negative: not initialized variables ( struct timeval)) 2013-01-19 12:48:56 +01:00
Daniel Marjamäki 2c6b383822 Uninitialized member variables: Improvements 2013-01-17 21:04:22 +01:00
Daniel Marjamäki 5773e69ab1 Uninitialized variables: Add experimental checking of struct members 2013-01-16 20:28:29 +01:00
Andrew C. Martin 4a73c93750 Fix compiler warnings and comment/string typos
- fix g++ warning:

> lib/checkother.cpp:3779: warning: comparison between signed and unsigned integer expressions

 - fix suncc warning (see [everything2](http://everything2.com/title/C%252B%252B%253A+static+extern+%2522C%2522)):

> "lib/checkmemoryleak.cpp", line 578: Warning (Anachronism): Formal argument __compar of type extern "C" int(*)(const void*,const void*) in call to bsearch(const void*, const void*, unsigned long, unsigned long, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).

- prefer empty() / isEmpty() over "size() > 0" (cases not caught by stlSize)

- fix word misspellings (mostly comments, a few output lines)

  - Parenthesis => Parentheses (both variations were used in the codebase)

  - fix typo and wording ("never alwayw") in gui/test/data/benchmark/simple.cpp's CheckOther::unsignedPositive():

```
-  "An unsigned variable will never alwayw be positive so it is either pointless or "
+  "An unsigned variable can't be negative so it is either pointless or "
```
2013-01-16 07:37:07 -07:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Daniel Marjamäki ccdea4dc2b Uninitialized variables: Improved checking of functions 2012-12-20 19:45:30 +01:00
Daniel Marjamäki 68327b3c64 Uninitialized variables: Fixed TODO testcase 2012-11-29 18:41:48 +01:00
XhmikosR 6e4e3dfbfb lib: tabs to spaces, remove trailing spaces and extra empty lines at the end of files 2012-09-17 13:51:23 +02:00
PKEuS 1b40668e04 Refactorizations:
- Made several functions (Check*::myName and others) because they don't touch depend on a specific instance. (cppcheck findings)
- Removed description of a check in CheckConst that has moved to CheckIO
2012-08-02 09:50:48 -07:00
PKEuS 4b80e91145 Implemented support for building cppcheck lib into a dll
Updated VS9 solution
New VS10 solution that builds cppcheck into a dll used by cli and testrunner.
Functional changes and advantages of new solution:
- Share code between testrunner and cli; ability to share code with gui as well (not yet implemented)
- Files of /lib are no longer compiled twice (should improve build time on single core machines)
- Added configuration for building with PCRE support
- Executables are build into /bin (/bin/debug in debug mode) folder (Should no longer require rebuild when switching between debug and release)
- Completely x64 compatible (contains also x64-debug configuration now)
2012-06-10 05:19:09 -07:00
PKEuS 79445e52ad Refactorized CheckUninitVar to use SymbolDatabase 2012-05-25 04:40:18 -07:00
PKEuS b37cf11d20 Refactorizations:
- Increased encapsulation by making some functions private
- Removed redundant function CheckBufferOverrun::ArrayInfo::declare
- Avoided copy of ArrayInfo object
- Removed unnecessary and suspicious "if(sizeof(int) == 4)"
2012-03-27 19:40:39 +02:00
PKEuS b1ff900aaa Some refactorizations 2012-02-18 23:43:51 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
Daniel Marjamäki 5aaec7adc5 Uninitialized variables: Better handling of variable usage in condition 2011-12-26 18:56:40 +01:00
Daniel Marjamäki 59cd099ba7 Uninitialized variables: Fixed false positives caused by recent commit when potentially uninitialized variable is read in condition 2011-12-26 18:32:42 +01:00
Daniel Marjamäki 8eb067358c Uninitialized variables: check more variables 2011-12-26 14:01:46 +01:00
Daniel Marjamäki f48edb63a3 Uninitialized variables: Improved checking when there are multiple if/else and a certain path causes an error 2011-12-26 12:36:35 +01:00
Daniel Marjamäki 8e3e634ce0 Uninitialized variables: Detect more errors. Ticket: #3369 2011-12-14 18:28:30 +01:00
Daniel Marjamäki 458fa0874a Uninitialized variables: Started writing a new check. Ticket: #3369 2011-12-13 21:57:27 +01:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Daniel Marjamäki c7d0beefa8 uninitstring: fix false negatives when non-zero memset is used. Ticket: #3050 2011-09-05 19:42:48 +02:00
Greg Hewgill be195a72c9 initialise Check::_name in constructor rather than relying on virtual Check::name() 2011-02-02 22:58:25 +13:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Daniel Marjamäki 38e7209d26 Fixed #2373 (Using XML2 in --errorlist output) 2010-12-29 12:43:29 +01:00
Daniel Marjamäki bc283d8b99 Uninitialized variables: Broke out the checking into separate file 2010-10-31 12:31:11 +01:00