Commit Graph

13655 Commits

Author SHA1 Message Date
Oliver Stöneberg 14421ae627
fail `run-clang-tidy` in case of compiler warnings / fixed Clang warnings / cleanups () 2022-05-15 12:42:29 +02:00
orbitcowboy e02182bd88 Cleanup redundant parentheses 2022-05-15 07:53:32 +02:00
orbitcowboy 4f410ffb79
library: Improved argument <valid>-interface to defined values that are explicitly excluded. ()
* library: Improved <valid>-interface to defined values that are explicitly excluded.

* std.cfg: Improved configuration of remainder[fl]().

* Fixed failing self check

* Fixed failing self check

* std.cfg: Added support for std::remquo().
2022-05-14 16:05:18 +02:00
chrchr-github 52f507d1fb
Fix unintentional semicolon in expression '.. ; +dostuff();' ()
* Fix  unintentional semicolon in expression '.. ; +dostuff();'

* Improve error message

* Don't remove single unary + in front of variables
2022-05-13 06:54:02 +02:00
Paul Fultz II fbba72ab5a
Fix 11057: FP danglingTemporaryLifetime with reference member ()
* Fix 11057: FP danglingTemporaryLifetime with reference member

* Add test

* Format

* Use ast for number of arguments

* Get number of arguments using ast

* Skip aggregate constructor when there are too many arguments

* Format
2022-05-13 06:51:07 +02:00
Paul Fultz II 5f9bee9b91
Fix 11056: FP uninitvar with known condition in loop ()
* Fix 11056: FP uninitvar with known condition in loop

* Format
2022-05-12 06:37:48 +02:00
Paul Fultz II 5d8da2b83c
Fix 11035: FP arrayIndexOutOfBoundsCond with array and vector ()
* Fix 11035: FP arrayIndexOutOfBoundsCond with array and vector

* Format

* Move comment
2022-05-12 06:21:33 +02:00
chrchr-github e7e8b1baf9
Fix FN: "static" not suggested for non-const method ()
* Fix  FN: "static" not suggested for non-const method

* Format

* Make functions static

* static
2022-05-11 20:01:22 +02:00
chrchr-github 63a1698335
Fix FP multiCondition when variable is assigned in if/else () 2022-05-11 20:01:13 +02:00
chrchr-github 942dbad11c
Fix not getting expected warning in relational comparison of booleans ()
* Fix  not getting expected warning in relational comparison of booleans

* return nullptr
2022-05-11 08:09:32 +02:00
Daniel Marjamäki 72ba85a2fc AST: Fix AST for array size calculation in cast (char (*)[...]) 2022-05-10 22:47:57 +02:00
Daniel Marjamäki 4257f9d46a Tokenizer: fix for __attribute__ before function that returns a reference 2022-05-10 20:59:24 +02:00
chrchr-github a70d11adb6
Fix inline static global struct declaration interferes with checks () 2022-05-10 20:43:11 +02:00
chrchr-github 759c16fcef
Fix boolean expressions ()
* Enable experimental check

* Remove experimental

* Don't compare Booleans using relational operators

* Fix boolean expressions
2022-05-10 20:42:24 +02:00
Daniel Marjamäki 0a4e2abf01 dump: add token isComplex attribute 2022-05-10 19:05:02 +02:00
chrchr-github e2bb77f990
Remove severity 'experimental' from checkComparisonOfBoolWithBool() ()
* Enable experimental check

* Remove experimental

* Don't compare Booleans using relational operators
2022-05-10 18:25:13 +02:00
chrchr-github 52cbbb0229
Fix FP uninitMemberVar with defaulted special member functions ()
* Fix  FN: duplicateExpression with multiple strings compared

* Fix compiler warning

* TODO -> ASSERT

* Update testautovariables.cpp

* Improve error message

* Format

* Improve message

* Fix FP with defaulted operator=

* Fix condition
2022-05-10 13:04:45 +02:00
chrchr-github 54f832a2fe
Fix FN: duplicateExpression with multiple strings compared () 2022-05-09 21:05:35 +02:00
chrchr-github 38bdece3fe
Fix False negative: Uninitialized struct member (default constructor) ()
* Fix  False negative: Uninitialized struct member (default constructor)

* Format

* Initialize variables

* Init
2022-05-09 20:28:21 +02:00
Paul Fultz II be6daa94bb
Fix 11053: Integer division by zero in calculate.h ()
* Fix 11053: Integer division by zero in calculate.h

* Format
2022-05-09 20:27:32 +02:00
Paul Fultz II 69f09da63e
Fix 11044: FP knownConditionTrueFalse after early return ()
* Fix 11044: FP knownConditionTrueFalse after early return

* Format
2022-05-09 20:26:52 +02:00
Oliver Stöneberg c71033548f
fixed some clang-tidy warnings () 2022-05-08 20:42:06 +02:00
Daniel Marjamäki eb9c4b4aed Tokenizer: Fix handling of __attribute__ for overloaded operator function 2022-05-08 18:19:52 +02:00
Daniel Marjamäki fab55287f7 Tokenizer: improved handling of __asm__ in function declaration 2022-05-08 16:03:09 +02:00
Daniel Marjamäki 449d351095 Revert "Tokenizer: handle when __asm__ directive is provided for function"
This reverts commit f25b8cf662.
2022-05-07 21:53:10 +02:00
Daniel Marjamäki f25b8cf662 Tokenizer: handle when __asm__ directive is provided for function 2022-05-07 19:40:03 +02:00
chrchr-github 612d7be85a
Fix syntaxError with unknown macros and using namespace () 2022-05-05 19:47:56 +02:00
Paul Fultz II 843f7893d6
Fix 11040: FP nullPointer after loop () 2022-05-05 06:55:02 +02:00
Paul Fultz II 8d16ee946c
Fix 11027: False positive: containerOutOfBounds from condition in assert ()
* Fix 11027: False positive: containerOutOfBounds from condition in assert

* Format
2022-05-05 06:54:44 +02:00
Paul Fultz II 5afd6880c3
Fix 11028: False positive: invalidContainer ()
* Fix 11028: False positive: invalidContainer

* Format
2022-05-05 06:54:36 +02:00
chrchr-github adba751217
Fix FP uninitvar with redundant pointer op ()
* Skip redundant pointer op

* Fix   FP uninitvar with redundant pointer op

* Format
2022-05-05 06:54:27 +02:00
chrchr-github aebc080c0f
Fix FN constVariable with array of pointers [regression] ()
* Fix  FN constVariable with array of pointers [regression]

* Use std::vector for deterministic order of results, use helper variables
2022-05-05 06:54:03 +02:00
chrchr-github 9a379925cd
FIx FN shadowVariable in static function ()
* FIx FN shadowVariable in static function

* Use functionOf
2022-05-04 17:56:16 +02:00
chrchr-github e2069dd1b9
Fix FN knownConditionTrueFalse with const int value () 2022-05-04 14:25:00 +02:00
Paul Fultz II 496b45f27b
Fix 11009: FP uninitvar ()
* Fix 11009: FP uninitvar

* Format
2022-05-04 05:59:01 +02:00
chrchr-github 1e40a2e73e
Fix C-style pointer casting not detected for casts to ** () 2022-05-03 20:15:42 +02:00
chrchr-github 509e42afd4
Fix FN duplicateCondition with struct member ()
* Fix  FN duplicateCondition with struct member

* Update testcondition.cpp
2022-05-03 19:57:30 +02:00
chrchr-github 51b4cf592b
Fix unknownMacro reported with noexcept (regression) () 2022-05-03 13:37:14 +02:00
Paul Fultz II 3edb10a006
Fix 11024: FP returnDanglingLifetime with c_str() passed to constructor () 2022-05-03 11:42:32 +02:00
chrchr-github 8ce0faf723
Fix Regression: selfInitialization () 2022-05-02 16:49:13 +02:00
chrchr-github 67f4fe575f
Fix syntaxError with attribute for function pointer () 2022-05-02 15:05:48 +02:00
chrchr-github e9a0d7979e
Fix FN redundantPointerOp / remove simplifyMulAndParens() () 2022-05-01 15:46:07 +02:00
Paul Fultz II 3e686103ae
Fix 10984: False positive: invalidContainer when explictly capturing vector by reference () 2022-04-30 09:36:28 +02:00
Paul Fultz II 4e7125554f
Fix 8358: FP: Condition '(number*0)!=0' is always false () 2022-04-30 09:35:51 +02:00
Paul Fultz II 9fa5c4e201
Fix 11011: FP returnDanglingLifetime with non-const reference argument [inconclusive] ()
* Fix 11011: FP returnDanglingLifetime with non-const reference argument [inconclusive]

* Format
2022-04-30 08:23:58 +02:00
chrchr-github e7afb3045b
Fix FP redundantPointerOp with macro ()
* Fix  FN: Redundant pointer operation

* Fix FP redundantPointerOp

* Check for LValue

* Fix FP redundantPointerOp with macro

* Format
2022-04-29 13:23:50 +02:00
chrchr-github 0467ab1339
Fix FN memleak with cfg () 2022-04-28 19:50:16 +02:00
chrchr-github 8dbe6994a2
Fix FP redundantPointerOp ()
* Fix  FN: Redundant pointer operation

* Fix FP redundantPointerOp

* Check for LValue
2022-04-28 15:25:31 +02:00
chrchr-github 3d3885d151
Add test for / Remove noisy assert ()
* Add test for 

* Remove noisy assert
2022-04-28 15:24:54 +02:00
Paul Fultz II aafd1e10be
Fix 11006: FP uninitvar with unknown constant () 2022-04-28 10:48:37 +02:00