Commit Graph

83 Commits

Author SHA1 Message Date
Daniel Marjamäki 2679b576c2 Fixed #1693 (false negative: std::vector, negative index) 2017-08-22 11:04:02 +02:00
Ayaz Salikhov b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +02:00
Daniel Marjamäki abf525e46d Fix Cppcheck warning 2017-07-29 11:58:00 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 633ed23c0d Fix Cppcheck warnings about mismatching function argument names 2017-04-01 09:31:27 +02:00
Daniel Marjamäki c8667096e0 Fixed #7658 (False positive: Same iterator is used with different containers) 2016-08-14 10:49:48 +02:00
amai2012 eba1b0881d Minor refactoring: use nullptr (instead of 0/NULL), change signature of Tokenizer::createTokens 2016-05-07 16:30:54 +02:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
PKEuS c0e33e20b4 Reimplemented CheckStl::readingEmptyStlContainer() based on Libraries 2015-11-20 15:53:14 +01:00
PKEuS 53b2eca983 Reimplemented CheckStl::stlBoundaries() based on Libraries; Added support for iterators to libraries 2015-11-20 15:53:14 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
PKEuS 795e5de903 Refactorization: Cleaned up after ExecutionPath removal 2015-07-23 20:37:09 +02:00
Daniel Marjamäki 3dbf290220 Refactor CheckStl::erase so it doesn't use ExecutionPath 2015-07-23 18:53:31 +02:00
PKEuS 4cbbd44d49 Fixed false positive #6663: Better support for loops in CheckStl::readingEmptyStlContainer() 2015-05-02 14:09:48 +02:00
Jakub Melka a49efb13f6 Added auto_ptr checking for malloc 2015-03-19 06:41:54 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
Daniel Marjamäki 051d42ae6b astyle formatting 2014-11-20 14:20:09 +01:00
orbitcowboy f5d804f71a running astyle 2014-11-20 10:13:03 +01:00
Daniel Marjamäki fbc6323a9b doc: changed --doc output to Markdown syntax 2014-09-30 14:56:12 +02:00
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
Pranav Khanna f8a4fb91fe Fixed #3796 (new check: redundant initialization with empty string) 2014-03-03 18:27:45 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +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
PKEuS 917acea2ca Fixed two spelling mistakes found by ettlmartin 2013-06-12 13:13:05 -07:00
zblair ecfe4eb5be Fixed #3372 (New check: dereference iterator and then checking it) 2013-04-04 21:14:59 -07:00
Daniel Marjamäki 08ada4cc63 Fixed #2652 (container .size() check too strict) 2013-02-14 16:59:58 +01:00
Andrew C. Martin bd0d9b9639 fix misspellings & gcc v3.4.6 warnings
1.  fix typos / misspellings
 - Fix misspelling within comments, variable/function names, stdout messages
 - changes the name of an error code: ```stlBoundries``` changed to ```stlBoundaries```.  Alias old name (```stlBoundries```) to the new one.

2.  fix gcc v3.4.6 32bit & 64bit warnings

 - fixes gcc v3.4.6 warnings, except for those in tinyxml and "-Wmissing-declarations" makefile warnings
 - in Preprocessor::handleIncludes(), replace a ```vector <bool>``` with ```stack<bool>``` (see ```vector<bool>``` warning below).
   - this is the only ```vector<bool>``` in the codebase
 - ```vector <bool>``` is actually a case of template specialization, and is not recommended, according to the following links:

http://stackoverflow.com/q/6461487
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2160.html
http://stackoverflow.com/q/670308

 - in the codebase before and after this change, testrunner SEGVs in a number of places on gcc v3.4.6, including ```Check::~Check()```, among others
   - fc42fc95 fixes this particular runtime issue for DJGPP & __sun
2013-02-09 23:43:09 -07:00
Robert Reif 3e3b728a9c CheckStl: Use Token::variable. ticket: #4535 2013-02-05 06:46:26 +01:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Edoardo Prezioso b50e1f4451 Attempt to fix all doxygen warnings. 2012-10-24 01:32:07 +02:00
Edoardo Prezioso c1718ae38d Fixed g++ -Wshadow warning message. 2012-10-17 00:29:06 +02:00
PKEuS 2aae8381cc Message refactorization: checkstl.cpp 2012-10-14 11:16:48 +02: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 5940d77a62 Disabled C++ specific checks and simplifications when checking a C or non-C++ file. 2012-09-10 19:02:32 +02:00
PKEuS e87ebcc602 Added support for std::unique and std::remove_if to CheckStl::uselessCalls(). 2012-09-07 14:23:32 +02:00
PKEuS 046712aaec Removed --doc formating hack that removes more than three newlines and added format testing of Check::classInfo instead.
- Fixed test failures shown by new test.
Use const_iterator instead of iterator in testcppcheck.cpp when possible
2012-08-26 16:22:46 +02:00
PKEuS a5bca705a5 New check: Ensure that the return value of std::remove() is used. 2012-08-21 02:30:27 -07: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 5a91d6a0f5 Check for useless calls of .empty() (#3816)
Messages from CheckStl::uselessCalls() only shown when correct severity is enabled.
2012-07-12 03:23:52 -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 bef2caf489 Improved checks in CheckStl:
- Improved message of stlIfStrFind according to discussion on github (77d9ed1877)
- Generalized pattern for substr in CheckStl::uselessCalls; added check for substr calls like ".substr(%any%,0)" which result in an empty string.
2012-04-04 19:40:28 +02: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 9431fb1b7e Improved STL checks:
- Added performance checking for .c_str() for return values and function parameters (#1079)
- Added more containers (basic_string, C++11 containers) and more functions to checking (.at, .resize, .reserve, ...)
- Make use of symboldatabase in missingComparision check
2012-02-25 12:43:27 +01: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
PKEuS 2fa0168e55 Patch that improves STL checking: Make use of SymbolDatabase, solved TODO (about returning .c_str() value), check for deleting iterators by value. 2011-12-17 11:21:34 +01:00
Marek Zmysłowski 9a8c48b36e Fixed #3255 (Error message for std::string::c_str() is not descriptive) 2011-11-20 19:26:07 +01:00
Thomas Jarosch 4342fd254c Fixed #3266 (False positive on dangerous usage of .c_str()) 2011-11-04 19:21:19 +01:00
Daniel Marjamäki b18778129c STL: updated error messages for 'useless call to find/swap/substr'. Ticket: #3258 2011-10-31 21:32:30 +01:00