Commit Graph

10424 Commits

Author SHA1 Message Date
Daniel Marjamäki e17ddfd964 Changed AST for variable declarations with initializations 2019-03-09 19:09:15 +01:00
Daniel Marjamäki 1b4895a579 ValueType: Set ValueType for false/true 2019-03-09 17:27:27 +01:00
Daniel Marjamäki 5a32d2d017 Moved CheckAutoVariables::autoVariables to normal checking 2019-03-09 16:53:43 +01:00
Daniel Marjamäki 38d5712aaa Moved CheckAssert::assertWithSideEffects to normal checking 2019-03-09 16:50:50 +01:00
Daniel Marjamäki b9ac77a31b Uninitialized variables: Fixed false positive 2019-03-09 11:30:45 +01:00
Daniel Marjamäki f36ca56e7d Moved CheckStl::redundantCondition to normal checking 2019-03-09 07:53:49 +01:00
Daniel Marjamäki f9fe6cc96a STL: Removed auto_ptr checking. 2019-03-09 07:48:01 +01:00
Daniel Marjamäki d7a645dcc3 Moved CheckStl::uselessCalls to normal checking 2019-03-09 07:37:08 +01:00
Rikard Falkeborn a53b016414 checknullpointer: Remove duplicated include (#1732) 2019-03-08 20:55:09 +01:00
Daniel Marjamäki 45a0c2ebf5 Revert "Moved CheckStl::checkAutoPointer to normal checking"
This reverts commit 6dc9727ffd.
2019-03-08 20:53:37 +01:00
Daniel Marjamäki 6dc9727ffd Moved CheckStl::checkAutoPointer to normal checking 2019-03-08 20:41:28 +01:00
Daniel Marjamäki 95a20c0233 Moved CheckStl::string_c_str to normal checking 2019-03-08 20:39:43 +01:00
Daniel Marjamäki fdf1d6fdee Moved CheckStl::erase to normal checking 2019-03-08 20:36:40 +01:00
Daniel Marjamäki fdfe39299c Moved CheckStl::pushback to normal checking 2019-03-08 20:33:16 +01:00
Daniel Marjamäki 5fe48f3cd2 Moved CheckStl::mismatchingContainers to normal checking 2019-03-08 20:31:00 +01:00
Daniel Marjamäki b91bb2e523 Moved CheckStl::iterators to normal checking 2019-03-08 20:28:28 +01:00
Daniel Marjamäki 8f2d70e61d Move CheckStl::if_find to normal checking 2019-03-08 20:23:37 +01:00
Daniel Marjamäki 725abbfac3 Move CheckStl::missingComparison to normal checks 2019-03-08 20:19:40 +01:00
Daniel Marjamäki 75ce67f4b8 Fixed #9027 (cppcheck on Centos 7 - segmentation fault below CheckCondition::multiCondition2) 2019-03-08 19:27:20 +01:00
Sebastian c8003d47e2
checkuninitvar.cpp: Use argument direction "out" info from library cfg (#1730)
CheckUninitVar::isMemberVariableAssignment uses argument direction "out"
now also to check for assignment when the member variable is handed over
to a function by reference.
testuninitvar.cpp: Improve tests, use a test library configuration.
2019-03-08 18:42:24 +01:00
amai2012 eb9edbc177 #9024 Crash caused by package "procserv" in lib/token.h:921 function Token::getKnownIntValue - Fix and test for alternative code example. 2019-03-08 11:07:33 +01:00
Daniel Marjamäki 6eaf2c03d9 CheckOther::checkInvalidFree: Move check to normal checking. And clarify the message. 2019-03-07 06:35:44 +01:00
Daniel Marjamäki 17e73fd144 Move CheckOther::checkComparisonFunctionIsAlwaysTrueOrFalse to Normal checking 2019-03-06 21:27:19 +01:00
Daniel Marjamäki f20936ed8a Moved CheckOther::checkPassByReference to normal checking 2019-03-06 20:59:45 +01:00
Daniel Marjamäki 9d5f672dbc Unused struct member: Fix FPs seen in daca@home results for template structs 2019-03-06 20:51:48 +01:00
Daniel Marjamäki 572d7eb86c Moved CheckOther::clarifyCalculation to normal checking 2019-03-06 20:43:28 +01:00
Daniel Marjamäki ee9053f219 Moved CheckOther::checkRedundantCopy() to normal checking 2019-03-06 20:38:13 +01:00
Sebastian 6228ea2266
checkuninitvar.cpp: Use argument direction info from library config. (#1728)
CheckUninitVar::isMemberVariableAssignment uses argument direction
to check for assignment when the member variable is handed over to a
function by reference. Currently implemented for "in" direction. "out"
will be added with another commit.
2019-03-06 19:26:38 +01:00
Daniel Marjamäki ad37664e86 Changed severities 2019-03-06 19:00:58 +01:00
Daniel Marjamäki c32d015337 Fixed false positives from terminateStrncpy 2019-03-06 18:50:50 +01:00
Daniel Marjamäki 3f37d5ac2d Refactoring strncpy/strncat checking to use ValueFlow and AST 2019-03-06 09:04:04 +01:00
Daniel Marjamäki 37814513f8 Revert "Moved all simplified CheckOther checks from simplified to normal checking"
This reverts commit 2900690881.
2019-03-06 07:08:56 +01:00
Daniel Marjamäki 2900690881 Moved all simplified CheckOther checks from simplified to normal checking 2019-03-06 06:33:51 +01:00
Daniel Marjamäki 06c2019676 Moved CheckOther::checkPipeParameterSize from simplified to normal checking 2019-03-06 06:28:13 +01:00
Carlo Marcelo Arenas Belón cb973cbb7b lib: reorders settings to match definition (-Wreorder) (#1727)
lib/settings.cpp:53:7: warning: field 'removeUnusedIncludedTemplates' will be
      initialized after field 'removeUnusedTemplates' [-Wreorder]
      removeUnusedIncludedTemplates(false),
      ^
lib/settings.cpp:54:7: warning: field 'removeUnusedTemplates' will be
      initialized after field 'checkConfiguration' [-Wreorder]
      removeUnusedTemplates(false),
      ^
2019-03-06 06:12:02 +01:00
Daniel Marjamäki fda0f52424 Add --remove-unused-templates flag to remove all unused templates 2019-03-05 14:58:02 +01:00
IOBYTE 5ee6c2138c Fixed #9016 (tokenizer: wrong simplification for operator ^ (){}) (#1724) 2019-03-05 11:35:45 +01:00
Sebastian 0934577dda
Library configuration: function argument direction fixes and enhancements (#1722)
* std.cfg: Add further argument directions (in, out, inout).

* testlibrary.cpp: Add test for function argument direction configuration.

* std.cfg: runastyle and add some more direction configurations.

* library.h: Add documentation for function argument direction enum.

* Do not use "direction" library information for pointer arguments.

Also fix further unmatched uninitvar messages in std configuration
tests.

* std.cfg: Add more argument direction configurations.

* test/cfg/std.c: Add test for argument direction configuration.

* astutils.cpp: Only ignore pointer arguments for out/inout arguments.

* library.h: Use suggested documentation for argument direction enum.
2019-03-04 22:57:40 +01:00
Daniel Marjamäki 3675318208 Added --remove-unused-included-templates option 2019-03-04 19:10:49 +01:00
Daniel Marjamäki c5a512338e --check-headers=no: remove more templates in headers that are not used in the source file 2019-03-03 20:18:54 +01:00
IOBYTE 40d7d5a3d0 template simplifier: fix return type of out of line member function when it is a template parameter (#1723) 2019-03-03 19:42:46 +01:00
Daniel Marjamäki 41db8afe87 --check-headers=no: remove templates in headers that are not used in the source file 2019-03-03 12:56:37 +01:00
Daniel Marjamäki eb109af00f Replace Token::simpleMatch with Token::Match for complex pattern 2019-03-03 12:40:55 +01:00
Daniel Marjamäki 59ec5f961f --check-headers=no: remove types in headers that are not used in the source file 2019-03-03 12:36:33 +01:00
Daniel Marjamäki 411a3f09f7 --check-headers=no: Remove unused function declarations 2019-03-03 09:18:12 +01:00
IOBYTE b222953bae template simplifier: only constant fold template instantiation arguments (#1721)
* template simplifier: only constant fold template instantiation arguments

* Fix travis build.
2019-03-03 07:40:55 +01:00
Daniel Marjamäki f5c274b3b1 Added '--check-headers=no' option. 2019-03-02 19:52:15 +01:00
Daniel Marjamäki 8a3b73ffdb Do not write extra uninitvar warnings 2019-03-02 13:17:15 +01:00
Sebastian 9a5fcddb5d
Library configuration: Enable configuring the direction of arguments. (#1717)
This enhances the library configuration so the direction of function
arguments can be specified (in, out, inout).
isVariableChangedByFunctionCall() uses this information now to avoid
guessing.
2019-03-01 15:47:08 +01:00
Daniel Marjamäki 845c407ab7 Fixed pattern matching in isVariableChanged() to handle normal token list better 2019-03-01 13:23:03 +01:00