Commit Graph

11905 Commits

Author SHA1 Message Date
Paul Fultz II 117a753b10
Partial fix 11154: FN: knownConditionTrueFalse ()
* Partial fix 11154: FN: knownConditionTrueFalse

* Formay

* Add more tests

* FOrmat

* Fix FP

* Add test

* Check for side effects

* Format

* Update tests

* Format
2022-09-08 22:08:38 +02:00
Oliver Stöneberg dbc05da356
fixed some clang-tidy warnings () 2022-09-08 20:01:41 +02:00
Paul Fultz II 7c986fbef1
Fix 11203: false positive: knownConditionTrueFalse 'always false' when comparing integer with floating-point () 2022-09-08 19:59:02 +02:00
Paul Fultz II f83b8dd385
Fix 11194: FN: knownConditionTrueFalse ()
* Fix 11194: FN: knownConditionTrueFalse

* Format
2022-09-08 18:51:44 +02:00
Daniel Marjamäki 92845295b8 Fix broken CI caused by my qt fix 2022-09-08 11:12:38 +02:00
Paul Fultz II 32d96104d6
Fix 6370: ValueFlow: array element with known value ()
* Fix 6370: ValueFlow: array element with known value

* Format

* Move comment
2022-09-07 19:16:07 +02:00
Paul Fultz II 6543b429c5
Fix 11285: FN: zerodiv ()
* Fix 11285: FN: zerodiv

* Format
2022-09-07 19:15:37 +02:00
Oliver Stöneberg 54771306c5
selfcheck : cleaned up some suppressions, fixed warnings and some cleanups ()
* cleaned up triage.pro and pass all triage files to selfcheck

* CI-unixish.yml: factored out redundant selfcheck flags

* CI-unixish.yml: cleaned up selfcheck suppressions and fixed warnings

* added explicit `missingInclude` checks to selfcheck to work around current issues/limitations / fixed selfcheck includes / added some unit tests for `missingInclude`

* applied the selfcheck changes to the sanitizer jobs

* only fail TSAN CI build in case of TSAN error / updated sanitizer CI build TODOs
2022-09-06 23:11:39 +02:00
chrchr-github 6960332f8a
Fix FP arrayIndexOutOfBoundsCond with extra parentheses () 2022-09-06 21:21:06 +02:00
Oliver Stöneberg b3762cd76a
actually perform system tinyxml2 build on macos / fixed system tinyxml2 include ()
* lib/CMakeLists.txt: removed unnecessary external include

* look up tinyxml2 include dir when using system one and specify it

* lib/CMakeLists.txt: do not treat bundled headers as system ones

* CI-unixish.yml: actually perform system tinyxml2 build on macos
2022-09-06 18:30:59 +02:00
Paul Fultz II 2d37a77281
Fix 11296: FN: knownConditionTrueFalse ( a !=0 && b != 0 && a == 0) () 2022-09-06 07:31:48 +02:00
Paul Fultz II 016793f258
Fix 11295: Regression FP: knownConditionTrueFalse () 2022-09-06 07:31:38 +02:00
chrchr-github 31118fdce5
Fix noreturn FP with while() ()
* Fix checkLibraryFunction FPs

* Fix FP with fclose()

* Format

* Fix FP with reinterpret_cast

* Fix noreturn FP with while()
2022-09-04 10:26:31 +02:00
Paul Fultz II 6ce5c24f21
Refactor knownConditionTrueFalse check and isUsedAsBool function ()
* Refactor knownConditionTrueFalse check and isUsedAsBool function

* Format1

* Format

* Skip assign
2022-09-04 10:24:45 +02:00
Maksim Derbasov f93b588603
New check: use memcpy/memset instead of loop () 2022-09-03 23:29:06 +02:00
chrchr-github cf52ee098a
Fix checkLibraryFunction FPs ()
* Fix checkLibraryFunction FPs

* Fix FP with fclose()

* Format

* Fix FP with reinterpret_cast
2022-09-02 07:51:10 +02:00
chrchr-github 79daad8ff4
Fix FP arrayIndexOutOfBounds if string literals are assigned conditionally () 2022-09-01 22:59:46 +02:00
Daniel Marjamäki 4779f0e172 TemplateSimplifier: Fixed instantiation when template parameters are A<..>, B<..> 2022-09-01 20:24:01 +02:00
chrchr-github 5804cc44e7
Fix FP bufferAccessOutOfBounds ()
* Fix FN with buffer size 1

* Fix FP bufferAccessOutOfBounds
2022-08-31 19:31:37 +02:00
chrchr-github 3925a27182
Fix FP knowConditionTrueFalse ()
* Fix  FN (style) Condition 's.empty()' is always false

* Fix test

* Fix FP knowConditionTrueFalse

* Check for casts

* Fix FP for user-defined functions

* Adjust condition detection

* Tweaks
2022-08-30 18:08:24 +02:00
chrchr-github 9ab4f9976d
Fix FN (style) Condition 's.empty()' is always false ()
* Fix  FN (style) Condition 's.empty()' is always false

* Fix test
2022-08-29 12:25:10 +02:00
chrchr-github 1e14e360cb
Fix FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy) ()
* Fix  FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy)

* Fix cfg, validation

* Fix validation
2022-08-29 12:24:58 +02:00
chrchr-github df704361f6
Fix FN with buffer size 1 () 2022-08-29 12:24:44 +02:00
Daniel Marjamäki a400c94230 Update Copyrights 2022-08-28 14:22:12 +02:00
Daniel Marjamäki 5e0fc24bb7 Fixed (Syntax Error: AST broken, binary operator '!=' doesn't have two operands) 2022-08-27 18:02:19 +02:00
chrchr-github 7156afe003
Fix FN (error) buffer access out of bounds - known argument ()
* Fix  FN (error) buffer access out of bounds - known argument const char* argv[]

* Format
2022-08-26 17:27:54 +02:00
chrchr-github b815153b0c
Add test for () 2022-08-26 11:36:47 +02:00
chrchr-github 917496a844
Fix FN destructor with no definition hide mismatching alloc/dealloc ()
* Fix  FN destructor with no definition hide mismatching allocation / deallocation

* Format

* Fix test

* Format
2022-08-25 22:52:51 +02:00
chrchr-github 456c6b410e
Fix FN known strcpy parameter ()
* Fix  FN known strcpy parameter

* Parentheses

* Format
2022-08-24 21:23:45 +02:00
Daniel Marjamäki 112852f70b formatting 2022-08-24 08:53:59 +02:00
Oliver Stöneberg 467648bec6
fixed (potential hang with -j and --showtime= when using threads) - synchronized access to `TimerResults::mResults` / added TSAN to CI () 2022-08-23 20:30:45 +02:00
chrchr-github 13e8d5220c
Fix another c_strParam regression () 2022-08-23 20:26:36 +02:00
chrchr-github 4be7f689d7
Fix c_strParam regression ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format

* Fix c_strParam regression
2022-08-23 15:00:27 +02:00
chrchr-github 66fca7ba91
Detect more instances of c_str() misuse ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format
2022-08-22 14:06:10 +02:00
PKEuS d81a758850
LCppC backports: Refactorizations/Optimizations () 2022-08-21 17:21:02 +02:00
chrchr-github d351a97a0f
Fix FN stlcstrParam ()
* Fix  New check: Not needed c_str() operation

* Comment

* Fix error messages

* Handle more complex string expressions

* Fix  FN stlcstrParam

* Handle iterators

* Format

* Format

* Parentheses
2022-08-21 13:04:43 +02:00
Oliver Stöneberg 1202efb438
some `--exception-handling` related improvements () 2022-08-20 20:54:31 +02:00
chrchr-github b04bf7396f
Fix New check: Not needed c_str() operation () 2022-08-20 20:52:10 +02:00
chrchr-github 5cc8ef7e87
Add test for ()
* Add test for 

* Add test for 

* Revert
2022-08-20 19:23:55 +02:00
Oliver Stöneberg 1d95d1908d
refs - sped up `Library::detectContainerOrIterator()` by iterating the containers only once () 2022-08-20 12:14:55 +02:00
chrchr-github 2ab8de2650
Fix FP negativeMemoryAllocationSize with possible value () 2022-08-20 07:56:31 +02:00
Oliver Stöneberg f138df2909
mathlib.h: replaced slow `std::ostringstream` with `std::to_string()` in `MathLib::toString()` () 2022-08-19 20:44:24 +02:00
chrchr-github 80a486dda0
Fix FP virtual call in destructor even though class is final / Delete 'final' from specializations ()
* Add 'final' keyword

* Delete 'final' from specializations

* Fix  FP virtual call in destructor even though class is final

* Fix test
2022-08-19 18:26:00 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
chrchr-github 1aa259569e
Fix syntax error : int (operator"" _ii)(unsigned long long v) … ()
* Fix  syntax error : int (operator"" _ii)(unsigned long long v) { return v; }

* Format
2022-08-18 23:38:45 +02:00
chrchr-github 2fee7a6e3f
Add test for , ()
* Add test for 

* Add test for 

* Add test for 

* Format

* Add test for 

* Format

* Add test for 
2022-08-18 23:37:41 +02:00
chrchr-github 6a0c254d1f
Fix FP zerodiv (daca@home) ()
* Fix  FP zerodiv (daca@home)

* Format

* Parentheses

* clang-tidy
2022-08-18 20:38:36 +02:00
chrchr-github 4a64e20592
unusedScopedObject: Don't warn for void statements ()
* Fix unusedScopedObject FPs

* Simplify

* Simplify

* Fix test

* Don't warn for void statements

* Format
2022-08-17 19:45:46 +02:00
chrchr-github e9f1665d4f
Add test for ()
* Add test for 

* Add test for 

* Add test for 

* Format
2022-08-17 19:38:37 +02:00
chrchr-github 0978cc2d46
Add tests for , () 2022-08-17 10:01:49 +02:00