Commit Graph

263 Commits

Author SHA1 Message Date
Daniel Marjamäki 783f7f1648 Rename safeValues to unknownValues 2019-07-11 16:05:48 +02:00
Daniel Marjamäki 05d35b063d Function return: Extra check of safe function return values 2019-07-10 20:00:21 +02:00
Daniel Marjamäki c9906125de Safe functions: Check more possible function argument values 2019-07-10 16:59:05 +02:00
Daniel Marjamäki b94f4176f1 test/cli: execute addon 2019-04-14 15:00:03 +02:00
Daniel Marjamäki d3e7d09f5c Refactoring; Reorder Settings members alphabetically. 2019-04-13 15:34:50 +02:00
Daniel Marjamäki cb06aebdab Removed --std=posix. From now on, if you use --library=posix then the posix checks will be enabled. 2019-04-12 06:47:28 +02:00
Daniel Marjamäki f6b410b469 GUI: add setting for 'checkHeaders', 'checkUnusedTemplates' and 'maxCtuDepth' to project 2019-04-10 16:49:24 +02:00
Daniel Marjamäki bf9006737a Addons: Adding support in Cppcheck CLI to execute addons 2019-04-07 17:01:59 +02:00
Daniel Marjamäki c7155a8e08 Removed '--experimental-fast' flag 2019-03-17 08:19:56 +01:00
Sebastian 08d41ab8af
Load std.cfg before all other libraries (#1740)
- CLI: Save the libraries that should be loaded to a list and load them
after the std.cfg has been loaded.
- GUI: Load std.cfg (and windows.cfg / posix.cfg when applicable) before
setting other options and loading the other libraries.
In the project-file-dialog the std.cfg is searched first. If some
other library fails to load is is retried with first loading std.cfg.
- boost.cfg: Enable containers that depend on std containers.
2019-03-15 06:59:37 +01:00
Daniel Marjamäki fda0f52424 Add --remove-unused-templates flag to remove all unused templates 2019-03-05 14:58:02 +01:00
Daniel Marjamäki 3675318208 Added --remove-unused-included-templates option 2019-03-04 19:10:49 +01:00
Daniel Marjamäki f5c274b3b1 Added '--check-headers=no' option. 2019-03-02 19:52:15 +01:00
Daniel Marjamäki 4f232e41dd Add --experimental-fast option 2019-02-09 14:40:50 +01:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki 437800f46d CLI: Added --max-ctu-depth 2019-02-03 17:51:36 +01:00
IOBYTE f0cfe03f7b template simplifier: add cli --debug-template option to print the parsed template information (#1598) 2019-01-14 08:29:32 +01:00
Daniel Marjamäki ddbe4b89b5 Renamed --debug to --debug-simplified 2018-08-05 11:19:20 +02:00
Daniel Marjamäki 87b21f3e57 Renamed _terminated 2018-06-17 08:22:53 +02:00
Daniel Marjamäki bea6b32157 Renamed _enabled 2018-06-17 08:21:05 +02:00
Daniel Marjamäki 45379a3aa6 Updated copyright year for modified files
[ci skip]
2018-06-10 22:07:21 +02:00
Daniel Marjamäki f058d9ad08 CLI: Added more fields for --template and added a new --template-location. The gcc predefined template now matches latest gcc better. 2018-04-23 12:21:18 +02:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Daniel Marjamäki 5fa7a4edc4 GUI: save dumpfiles in buildDir if possible 2017-08-03 22:54:38 +02:00
Alexander Mai b4a58be113 #define HIDE_WRONG_DATA to get release mode build (hiding crashes on invalid AST/symboldatabase). Fix doxygen syntax. 2017-06-01 23:38:02 +02:00
Daniel Marjamäki 1f48b082d1 CLI: Add --output-file flag so results can be written to file directly. 2017-05-30 15:04:28 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 6967d68137 Add --plist-output argument 2017-05-16 14:07:23 +02:00
Daniel Marjamäki 8d75d1b920 Partial fix for #8028 (ValueFlow: Origin/callstack of value) 2017-05-15 20:05:11 +02:00
PKEuS 3432257390 Removed deprecated command --append 2017-05-14 11:57:04 +02:00
Alexander Mai c1cdcc158f Run astyle. Fix some Doxygen issues 2017-05-06 11:57:02 +02:00
PKEuS b1f4bd7504 Refactorization: Reimplemented Settings::_enabled as a bitfeld instead of std::set (#7995) 2017-04-11 11:49:26 +02:00
Matthias Krüger 35e7697474 switch some functions from const to static, as cppcheck suggests. 2017-02-27 13:51:33 +01:00
Daniel Marjamäki 9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
Daniel Marjamäki 6f133a397b Fixed #3492 (GUI: after edit project recheck use old settings) 2016-10-01 13:08:58 +02:00
Daniel Marjamäki 9dcad7115a Fixed #7743 (--config-exclude no longer supported) 2016-09-30 08:00:06 +02:00
Daniel Marjamäki a94628d8fc Settings: Make Settings::_terminated static. All threads and subchecks are terminated 2016-08-21 15:57: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
Daniel Marjamäki 09d6f4f0a4 1 2016-08-06 21:04:50 +02:00
Daniel Marjamäki 1c51fbce7a astyle formatting
[ci skip]
2016-08-01 13:01:01 +02:00
Daniel Marjamäki 09b6568ea2 Fixed #7646 (podtypes do not get proper valuetype) 2016-07-31 19:47:34 +02:00
Daniel Marjamäki 125d2f7a36 Some initial support for platforms that doesn't have 8-bit char 2016-01-05 13:16:00 +01:00
Daniel Marjamäki 79e663dd6f Settings: Remove '_' prefix for public member variables 2016-01-03 16:18:17 +01:00
Daniel Marjamäki 599327bfb1 cmdlineparser: Added -E option 2016-01-02 11:48:36 +01:00
Daniel Marjamäki 95009a4630 Merge pull request #745 from lanurmi/2016_ad
Update copyright year to 2007-2016.
2016-01-01 22:57:19 +01:00
Daniel Marjamäki b457ceef0e Settings: Added defaultSign 2016-01-01 17:33:59 +01:00
Daniel Marjamäki f5715c1496 Rename Unspecified platform type to Native 2016-01-01 16:39:41 +01:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki 1f16e72b19 Removed --debug-fp. The reduce tool should be used instead. 2015-12-10 10:44:36 +01:00
PKEuS ac17541ca9 Refactorizations:
- Fixed a few more MSVC warnings by using correct types
- Store severity as enum instead of string in Settings::Rule
2015-11-28 12:30:21 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Daniel Marjamäki 6545172d8c Revert "Add a dynamic rule enable/disable system"
This reverts commit 231b486e49.

There was regressions reported in tools/generate_and_run_more_tests.sh.
2015-10-09 21:56:19 +02:00
Albert Aribaud 231b486e49 Add a dynamic rule enable/disable system 2015-10-09 19:57:05 +02:00
Daniel Marjamäki a17f4d0a2d CLI: Added --debug-normal option that will show --debug output after 1st simplifications. This output is relevant for the 'normal' checkers. 2015-07-28 12:46:32 +02:00
PKEuS 92b867dd2c Fixed behaviour of --quiet/-q and its description 2015-07-25 17:55:12 +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
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
PKEuS 0a416910c4 Improved speed of testrunner: Avoid repeated loading of the same library 2014-09-10 20:29:44 +02:00
Daniel Marjamäki 8db5836e3f Fixed #5982 (Add xml dump) 2014-07-14 15:51:45 +02:00
PKEuS d9358de8b4 Refactorization: Use templates and rValue references
-> Performance gain of up to 15% on entire checking time (depends on setup; Result was checked with VS12 (x64), matchcompiled version, ran on tinyxml and cppcheck itself)
2014-04-03 15:03:37 +02:00
Troshin V.S 840fba7672 CLI: Add -l command line option 2014-03-25 18:35:59 +01:00
Alexander Mai 825bb0f027 Fixed #5286 (Add signal/exception handling to cppcheck and cppcheck-gui) 2014-03-16 12:04:13 +01:00
Julian Santander fae8ef48b8 Fixed #5529 (Further control in selecting what configurations to consider) 2014-03-10 15:49:02 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki 30cae358d8 Removed the --value-flow flag. ValueFlow analysis will always be enabled from now on. 2014-01-17 18:07:05 +01:00
Daniel Marjamäki d8270c710a Add new experimental value flow analysis 2014-01-04 20:57:02 +01:00
Alexander Mai ea10a722fc Fixed #5306 (Implement --showtime=top5) 2014-01-03 10:24:57 +01:00
Daniel Marjamäki 5ba02d2fdd AST: Always use AST 2013-12-09 18:06:19 +01:00
Daniel Marjamäki bbdfd8b5c7 Make it possible to create AST, by using the --ast flag 2013-11-02 18:37:35 +01:00
Robert Reif 44d86e97c0 Fixed #4920 (Microsoft ATL/MFC CString::Format argument checking) 2013-09-26 16:20:01 +02:00
Ettl Martin 9ab6655d85 Fixed #5007 (Same include guard naming) 2013-09-04 20:59:49 +02:00
Daniel Marjamäki 7d47fd65a2 Renamed --environment to --library. Added --check-library. Renamed Environment to Library 2013-07-08 18:26:18 +02:00
Daniel Marjamäki d96fb577cd CLI: Added --environment flag 2013-07-02 07:18:19 +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
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Simon Kagstrom ef28bde3e4 Fixed #4408 (Force inclusion of files (a la -include /.../ in GCC)) 2012-12-27 16:52:31 +01:00
PKEuS e5ebb49312 Added support for sizeof(wchar_t). Improved <Windows.h> type testing for Win64 platform. 2012-11-11 16:16:17 +01:00
PKEuS c84857fc7e Fixed compilation as shared lib with PCRE: Ensure that sizeof(Settings) is the same with and without HAVE_RULES
Fixed VS10 solution when TinyXml is included (define TIXML_USE_STL).
2012-11-03 20:37:23 +01:00
Daniel Marjamäki 1e024a9abc cleanup more java/c# code. Thanks amai for telling me about this. 2012-10-03 19:19:49 +02:00
PKEuS 50f9dd52ab Used enum instead of string in implementation for '--language='. 2012-09-11 08:53:27 +02:00
PKEuS 87131f6105 Added new cmdline option --language= (alias of GCC-like -x) to enforce a specific language. Valid values: c, c++, java, c#. (#3994) 2012-09-10 18:51:32 +02: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 06a77679d4 Refactorizations:
- Added support for pointers in self assignement check
- Removed redundant for loop in checknullpointer.cpp
- Fixed warning about signed/unsigned mismatch in cppcheck.cpp by making Settings::_maxConfig unsigned
2012-05-11 10:38:19 -07:00
PKEuS a420a36606 Removed deprecated cmdline options -s, --style, -a, --all, --auto-dealloc, --test-2-pass 2012-04-15 13:10:41 +02:00
PKEuS 7de545f0fe Refactorizations:
- Added forgotten initialization of Settings::_relativePaths
- Some PCRE-Rules specific code hidden behind HAVE_RULES
- Use initialization list in ErrorLogger::ErrorMessage::ErrorMessage() and CppCheck::CppCheck
- Avoided unnecessary copies of std::strings in cppcheck.cpp
- Moved "// Alert only about unique errors"-code to make it work in debugFalsePositive mode
2012-04-06 18:16:59 +02:00
PKEuS 25167b58a9 Implemented #2990: Print relative paths if -rp or --relative-paths is given 2012-04-06 10:49:21 +02:00
PKEuS 4b52df675a Some refactorizations 2012-02-18 14:44:04 +01:00
PKEuS 8ea5df62c4 - Improved support for numbers in code:
-- Use MathLib::toLongNumber for conversion in tokenizer (Fix #3610)
-- Handle octal numbers in tokenizer
- Refactorizations in MathLib::toLongNumber and Settings
2012-02-17 15:47:08 +01:00
Daniel Marjamäki 112873e876 Revert "Fixed #3450 (CLI --report-progress is currently useless)"
This reverts commit e769fe6294.
2012-01-02 07:42:39 +01:00
Daniel Marjamäki e769fe6294 Fixed #3450 (CLI --report-progress is currently useless) 2012-01-02 07:27:45 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
makulik 1e8fc71f8e Solution for ticket #3353 'Allow explicit undef's for configuration'
Signed-off-by: makulik <g-makulik@t-online.de>
2011-11-30 20:24:01 +01:00
Stefan Weil 785bc3d04b Optimize handling of --append=<file> option (execution time, memory)
Whitespace was removed from the append data for every configuration
and every file: n(configuration) * n(files).

Removing whitespace immediately after the append data was read can
significantly reduce the execution time and memory usage.
It also allows further improvement because copies to the temporary
object appendCode are no longer needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-11-15 19:27:36 +01:00
Stefan Weil d11f18b5df cmdlineparser: terminate with error message if --append=<filename> fails
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-11-15 19:27:36 +01:00
Daniel Marjamäki a9d2d45fbc astyle formatting 2011-10-22 11:11:54 +02:00
Daniel Marjamäki ab827e3631 Merge pull request #40 from joshbeck/master
Added option to set #ifdef configuration check limit
2011-10-22 00:51:05 -07:00
Marek Zmysłowski b332ea8222 Fixed #3204 (Refactor standards support in Settings) 2011-10-22 09:45:48 +02:00
Joshua Beck 56561835f8 Add option to set #ifdef configuration check limit 2011-10-18 19:52:55 -05:00
PKEuS f8074b71d2 Fixed #2470 (False negative: Possible null pointer dereference (C++0x keyword 'nullptr')) 2011-10-16 12:54:58 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Marek Zmysłowski 307dd00efb Fixed #3072 (improve check: deprecated function alloca) 2011-10-06 08:10:51 +02:00
Robert Reif f97424b242 start adding Windows ASCII TCHAR conversion support 2011-09-24 14:51:03 -04:00
Robert Reif be660003ec start adding conversions from common Windows types to standard types 2011-09-18 13:06:54 -04:00
Robert Reif b5d22fda0d fix #2888 (Allow defining sizes of base types) 2011-09-17 19:40:52 -04:00
Kimmo Varis 716679ec7d Move Suppressions class to own source files.
I want to use Suppressions class also in GUI. And that is easier
to do when it is not internal class of Settings class. And in
general is it more natural that Settings class only contains list
of suppressions and implementation is separate.
2011-08-22 19:57:28 +03:00
Daniel Marjamäki fe78e28d70 Cppcheck: Don't show information messages about interrupted checking unless --enable=information has been given. 2011-08-19 22:32:57 +02:00
Daniel Marjamäki afed93d7d6 Command line: Added --std option. Right now only --std=posix is possible but other options might be added later. 2011-08-17 20:08:55 +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
Daniel Marjamäki 01b9c0707d Settings: Removed the --enable=posix option. Ticket: #2949 2011-08-14 09:45:53 +02:00
Kimmo Varis cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Kimmo Varis f4950ea836 CLI: Rename --posix to --enable=posix.
Ticket: #2949 (new check: (style) finding non-reentrant functions)
Ticket: #2952 (CLI option --posix is wrong)
2011-08-03 10:28:36 +03:00
Ettl Martin 6b23dd9928 added a check to detect nonreentrant functions and a --posix switch 2011-07-29 18:27:01 +02:00
Daniel Marjamäki d998477c69 renamed --check-includes to --check-config 2011-05-02 21:28:33 +02:00
Daniel Marjamäki 8603919b2d Missing includes - normally just report that there are missing includes. The --check-includes can then be used to check what missing includes there are. Ticket: #2719 2011-05-02 14:58:16 +02:00
Daniel Marjamäki e5d43d4ed2 Renamed Settings::stupid to Settings::experimental 2011-04-10 15:55:08 +02:00
Daniel Marjamäki 30ee9ba6e4 Added Settings::stupid flag that can be used to hide checking that generates false positives. 2011-04-10 13:23:45 +02:00
Daniel Marjamäki 1178d47a9b --inconclusive : Added command line flag that enable inconclusive checking. It is added for experimental purposes. 2011-04-10 12:52:59 +02:00
Daniel Marjamäki 0dbf5c6151 fixed doxygen warnings about undocumented function parameters 2011-03-31 19:16:43 +02:00
Greg Hewgill a4de6a3455 be sure to list unmatched suppressions only for the currently processed file 2011-02-17 21:46:14 +13:00
Greg Hewgill 5d74325015 implement unmatchedSuppression information message 2011-02-16 23:02:37 +13:00
Greg Hewgill 331788246b factor out addSuppressionLine from file reading function 2011-02-16 22:26:16 +13:00
Greg Hewgill a9f2879889 factor out file matching into own class 2011-02-09 00:19:56 +13:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Daniel Marjamäki d005245188 fixed doxygen warnings 2010-12-30 22:13:31 +01:00
vBm 46a11183a5 Fixed some spelling mistakes 2010-12-15 18:45:53 +01:00
Daniel Marjamäki 2d3865a671 Add support for user defined rules 2010-12-12 11:56:22 +01:00
Daniel Marjamäki 11a0ac4e07 xml2: rename '--xmlver' to '--xml-version'. bugfix in settings, change the type of _xml_version from bool to int. 2010-12-04 14:20:51 +01:00
Daniel Marjamäki af80384ae7 xml2: replace --xml2 with --xmlver=2. Ticket: #2106 2010-12-02 17:32:51 +01:00
Daniel Marjamäki 12c8eeff2c xml2: Added experimental --xml2 result format. Ticket: #2106 2010-12-01 21:24:17 +01:00
Daniel Marjamäki d45186d645 Added --debug-warnings that we can use to enable various debug warnings 2010-08-27 20:28:00 +02:00
Daniel Marjamäki 6cb7fefdbf Added command line option --report-progress. ticket: #1926 2010-08-12 21:03:33 +02:00
Daniel Marjamäki 050011d287 Fixed #1881 (false positive: The function '...' can be const (nonconst code is hidden inside #if)) 2010-08-07 13:08:36 +02:00
Daniel Marjamäki 3adfc61eca gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487 2010-08-06 19:15:44 +02:00
Daniel Marjamäki a274cb1015 cleanup headers 2010-07-31 08:52:28 +02:00
Daniel Marjamäki 3ad8f98c61 Refactoring: Settings::addSuppression return error message and callers make sure it's reported properly. Ticket: #1839 2010-07-23 23:12:56 +02:00
Daniel Marjamäki 37c959023a Refactoring: The Settings::addEnabled will return error message instead of throwing it. Ticket: #1866 2010-07-23 13:29:16 +02:00
Daniel Marjamäki 4b0e3edfa4 Unit Testing: Test that suppressions work 2010-07-09 13:27:15 +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 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 Marjamäki c0e9a546f7 Refactoring: Refactoring the Settings class 2010-04-17 09:23:54 +02:00
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00
Daniel Marjamäki a7903c3385 dos2unix 2010-04-13 19:25:08 +02:00
firewave 89cdb088d6 More --showtime updates:
- removed "average"
- added number of results, average processing time and overall time to non-"file" output
2010-04-13 11:23:11 +02:00
Oliver Stoeneberg f992ac7da7 showtime: refactoring and improving. Added summary/file/top5/average options. 2010-04-12 22:13:42 +02:00