Commit Graph

127 Commits

Author SHA1 Message Date
Daniel Marjamäki 9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
Daniel Marjamäki 324f68ca36 rename function 2016-10-28 12:10:19 +02:00
Daniel Marjamäki 606e31602c Fixed #7177 (Support compile_commands.json) 2016-08-13 10:50:03 +02:00
Daniel Marjamäki c586ae8cbe Revert 'project' - it is not ready yet 2016-08-07 17:10:37 +02:00
Daniel Marjamäki 4dbdb50317 split 2016-08-07 15:35:41 +02:00
Daniel Marjamäki e0f4ce9358 vs 2016-08-07 13:55:27 +02:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Albert ARIBAUD (3ADEV) 58031147b2 Optimize tokenizing
Reorganize cppcheck.cpp to separate actual checking from
tokenizing and XML dumping. This implies splitting checkFile()
in three parts, checkRawTokens, checkNormalTokens() and
checkSimplifiedTokens().
2015-12-13 09:29:47 +01:00
Daniel Marjamäki 61da95010c Removed unused CppCheck::replaceAll() 2015-12-10 13:32:36 +01:00
Daniel Marjamäki 1f16e72b19 Removed --debug-fp. The reduce tool should be used instead. 2015-12-10 10:44:36 +01:00
Daniel Marjamäki a51df5f00d Removed unused CppCheck::analyseFile 2015-12-03 08:42:12 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Alexander Mai d4550c763d Exit code shall indicate that an internal error (syntax error) has been found. Add some const. Run astyle 2015-05-25 21:15:55 +02:00
Thomas Jarosch ec21134817 Fix false negatives for local suppressions
Introduce a new bool setting jointSuppressionReport
that will be set by the analyseWholeProgram() code path.

When the flag is enabled, unmatched suppressions are
collected after running the final whole program analysis
to prevent false positives for the unusedFunction check.

The check functions in the unit test
for single / multi file suppressions were unified.
2015-01-20 18:47:30 +01:00
Thomas Jarosch c92d861b1e Fix typo in "internal error" message 2015-01-12 23:09:17 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
Daniel Marjamäki 0b9d80c95d Refactoring CheckUnusedFunctions so it uses new infrastructure for multifile analysis 2014-12-02 06:41:18 +01:00
Daniel Marjamäki a002654c47 Reverted refactoring 828417c for now. It caused a major slowdown in the unused functions checking. 2014-11-24 06:37:08 +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 828417c934 CheckUnusedFunction: Refactorings to use same infrastructure for whole program analysis as CheckUninitVar and CheckBufferOverrun 2014-11-15 18:44:23 +01:00
Daniel Marjamäki de7e9223b8 Fixed #6272 (Improve check: multifile checking in checkbufferoverrun) 2014-11-15 10:43:49 +01:00
PKEuS b48bf1dbad Fixed GUI bug: file test.cpp is loaded from file if scratchpad is empty.
The underlying problem was in lib and is fixed by changing the behaviour of CppCheck::check(). Checking is performed on empty content without attempt to load from file.
2014-10-03 10:40:48 +02:00
PKEuS bf2f76e70c Detect and purge duplicate configurations by calculating a checksum. 2014-09-02 22:35:52 +02:00
PKEuS adf38fcfd0 Further include cleanup 2014-05-24 12:50:04 +02:00
PKEuS 9bfc2b618b Fixed crashes random crashes in multithreading caused by useless creation of CheckUnusedFunctions instance per thread. 2014-04-13 11:56:38 +02: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
Daniel Marjamäki 5e7791d847 astyle formatting 2013-08-31 13:17:15 +02:00
Daniel Marjamäki 997c9ce100 Refactor CppCheck::_fileContents to a function parameter 2013-08-31 10:28:21 +02:00
Daniel Marjamäki e6686dfb5b Cleanup CppCheck::dependencies() 2013-08-31 10:13:47 +02:00
Daniel Marjamäki 537166cf47 Rules: Make it possible run a rule on the 'normal' token list 2013-06-09 14:58:56 +02:00
Daniel Marjamäki 2f1050595d CppCheck: Added _simplify flag that can be used by clients to disable simplifications 2013-05-11 11:35:04 +02:00
Daniel Marjamäki b6bcdf2936 Fixed #4520 (segmentation fault of cppcheck (preprocessing)) 2013-05-09 18:50:24 +02: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 bfb82fe3e1 Cppcheck: Show single 'too many configurations' message if --enable=information hasn't been used and there are too many configurations. 2012-12-26 18:35:49 +01:00
Edoardo Prezioso fae40c4782 Change every C version of 'size_t' to C++ 'std::size_t'. 2012-07-09 13:30:18 +02:00
Edoardo Prezioso 3c4ce7b43a Fixed (for real) the preprocessor.cpp(1166) warning in #2123. 2012-07-06 13:17:08 +02:00
Kimmo Varis 68c52ddd69 Refactoring information messages.
Currently the information severity messages are outputted as error
messages with Severity::Information. This causes constant confusion
as people think it as mildest error severity (and rightfully so).
When it was meant to be for printing messages about the checking
procedure itself (like missing header files etc).

So I'm adding a new function for the ErrorLogger for printing these
informative messages. This makes clear the distinction of errors
found from the code and messages related to the checking itself.
It also makes it easier for clients to handle these separately.
2012-06-19 00:16:20 +03: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
Edoardo Prezioso eacf74be8d Changed the order of some structures in order to improve, even if for a bit, their padding. 2012-05-14 20:49:03 +02:00
PKEuS 772108374e Removed unused variable CppCheck::_errout. 2012-04-08 14:18:13 +02:00
PKEuS 6643e14d3c Avoid copying Settings in CppCheckExecutor 2012-04-06 14:19:26 +02:00
PKEuS 9a5f66030c Improved unused private function check:
- Fixed #3628
- Added support for friend
Improved symbol database:
- friend scopes are now set
- Added findScopeByName function
Refactorizations:
- Removed some unnecessary "virtual" keywords
- Removed unnecessary _filename member variable, pass it as argument instead
- Made CppCheck::replaceAll static, since it is independant from a specific CppCheck instance, Pass string to be modified by reference
2012-02-24 20:45:56 +01:00
PKEuS 9f42ce91a1 Refactored STL container usage in CLI.
Pathmatcher masks are converted to lowercase only once when instance is created
2012-02-19 17:22:59 +01:00
PKEuS b1ff900aaa Some refactorizations 2012-02-18 23:43:51 +01:00
PKEuS 4b52df675a Some refactorizations 2012-02-18 14:44:04 +01:00
Daniel Marjamäki 8f3d511871 lib: allow that file dependencies are taken from Cppcheck after a check 2012-02-15 08:08:28 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
PKEuS dca03c3ce2 Remove unnecessary includes
Also add a unit test related to #3427
Also improve the description text in checkclass and remove unused variable.
2011-12-23 23:31:48 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Reijo Tomperi dd666b7c1b Add command line option: --debug-fp ... If used, cppcheck will print out the code generating error into output stream.
This is ment to be used for debugging false positive errors in Cppcheck.
Current implementation tries two alternatives. Without all headers or with all headers and prints out the option with
less code. In future versions this could try with individual headers or group of header files.
2011-08-16 22:58:27 +03:00
Kimmo Varis 9e2dd553fb Add "ExtraVersion" version number information.
The "ExtraVersion" can be used for things like Git commit Id,
release tag (version control), release date etc. If the string
is empty, nothing is printed.
2011-08-11 17:34:59 +03:00
Daniel Marjamäki c1138cf7f9 Fixed #2941 (False positive: unused function (individual checking of files)) 2011-07-25 13:25:09 +02:00
Greg Hewgill 6d858b63a1 Report percentage complete based on file size
This patch makes the (reasonable) assumption that the total size of all checked
files fits in a 'long' type.
2011-04-26 22:26:23 +12:00
Kimmo Varis f240574107 Modify the Cppcheck class to check one file at a time.
Unify usage and API of CppCheck class. Allow only one file checked
at a time, instead of list of files. Clients can then handle file
lists more naturally and as they see fit. Also clients have better
knowledge of how checking status should be handled.

The single-threaded CLI checking was only one using the file list.
Other clients were giving files (to list) one file at a time.
2011-04-24 19:17:52 +03:00
Greg Hewgill 5d74325015 implement unmatchedSuppression information message 2011-02-16 23:02:37 +13:00
Kimmo Varis dffe1a0acd Fix doxgen comment. 2011-01-13 23:25:17 +02:00
Kimmo Varis 4668e19060 Modify Cppcheck::addFile() only take one file as a parameter.
CLI and GUI already do the directory walking for us and we have list
of files to check. So we were duplicating this directory walking.
Practically doing check again for each file if it is a directory.
Which can take some time with large amount of files.
2011-01-13 23:18:04 +02:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
vBm 46a11183a5 Fixed some spelling mistakes 2010-12-15 18:45:53 +01:00
Kimmo Varis 3551ce8b58 Remove unneeded includes. 2010-09-06 21:08:50 +03:00
Kimmo Varis 45eaebe423 Move CLI command line parsing to own class. 2010-09-05 11:17:31 +03:00
Daniel Marjamäki 11ef2c0a06 Refactoring: Cppcheck::reportProgress needs to call _errorLogger::reportProgress. Ticket: #1625 2010-08-08 08:46:47 +02:00
Daniel Marjamäki f5823f7747 Visual Studio: Fixed warnings 2010-08-06 17:32:16 +02:00
Daniel Marjamäki 9edecd4a3f Added ErrorLogger::reportProgress and removed ErrorLogger::ReportProgress. This will make it easier for GUI and other clients to display progress information. 2010-08-03 16:36:21 +02:00
Daniel Marjamäki 05c4138b2f Refactoring: Removed unused variable _xmllist 2010-07-24 18:57:38 +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
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00
Reijo Tomperi 9a4cbe0540 Changed CppCheck::parseFromArgs() to return boolean value and reportOut() in case of error.
It used to throw exception and return error message with the exception.
2010-04-11 22:53:21 +03:00
Reijo Tomperi be598757a1 Fix segmentation fault when calling with --errorlist and add a testcase for it. 2010-04-03 22:53:06 +03:00
Daniel Marjamäki 933289a6d7 doxygen: updated comments for Cppcheck and FileLister 2010-03-14 18:55:33 +01:00
Daniel Marjamäki 53d036fadf Added Cppcheck::terminate function that will terminate the checking ASAP 2010-01-18 20:23:50 +01:00
Daniel Marjamäki 6fd74dce47 exitcode suppressions. Partly fixes #1113 2009-12-28 11:26:52 +01:00
Daniel Marjamäki 599b04afbf Refactoring: Changed pointer to reference 2009-10-26 21:31:36 +01:00
Reijo Tomperi 1ee28ba444 Refactoring: Make Cppcheck::version() static
Update codeblocks projectfile
2009-10-25 22:06:58 +02:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00