Commit Graph

13823 Commits

Author SHA1 Message Date
chrchr-github 21d992cc00
Fix crash on Windows with -j option (#4229)
* Fix crash on Windows with -j option

* Disable CI-cygwin workflow

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Try to fix Cygwin build

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Cygwin uses THREADING_MODEL_FORK

* Restore workflows

* Remove comment

* Fix dmake

* Fix #11179 FP invalidFunctionArgStr

* Revert "Fix #11179 FP invalidFunctionArgStr"

This reverts commit dd5d3e67c6.
2022-07-13 13:46:03 +02:00
Daniel Marjamäki b387ae80f1 Fixed whole program analysis 2022-07-12 22:58:52 +02:00
PKEuS f3565e1056
Improvement: Support member variables in CheckOther::checkIncompleteArrayFill() (#4205)
Merged from LCppC.
2022-07-12 19:43:48 +02:00
chrchr-github 381c38b2f5
Improve check: uselessCallsConstructor (#4270) 2022-07-12 17:40:14 +02:00
Oliver Stöneberg 22be5f29aa
fixed #11183 (checkLibraryFunction with parameter to "std::string()") / added rudimentary tests for `CheckFunctions::checkLibraryMatchFunctions()` / added test for #10105 (#4265) 2022-07-12 17:39:01 +02:00
Daniel Marjamäki a93c2c5263 cppcheck: keep ctu-info files if there is a cppcheck build dir 2022-07-12 10:14:37 +02:00
chrchr-github 47c2a01392
Fix #11166 inefficient way to remove last character from std::string (#4267)
* Fix #11166 inefficient way to remove last character from std::string

* Format

* Modify message, add test

* Format

* Fix another warning
2022-07-11 23:07:37 +02:00
chrchr-github c5dcd49dae
Fix #4233 FN: Bitwise operation with bool and int (#4266)
* Fix #4233 FN: Bitwise operation with bool and int

* Format
2022-07-11 22:58:37 +02:00
chrchr-github 8fc75402a1
Fix #11179 FP invalidFunctionArgStr (#4264) 2022-07-11 22:58:19 +02:00
chrchr-github f9337b725b
Fix nullptr deref (#4262)
* Fix some FNs related to c_str()

* Format, fix FP

* Fix nullptr deref

* Fix merge
2022-07-11 22:58:08 +02:00
Oliver Stöneberg e8b0f12367
replaced `if(MATCHES)` with `if(STREQUAL)` (#4263)
`MATCHES` does regular expression matching which is not the intended behavior here. `Clang` still requires it since it also needs to match `AppleClang.
2022-07-11 10:46:18 +02:00
Armin Müller 0ae9877766
Typos found by running "codespell" (#4260) 2022-07-10 22:40:05 +02:00
chrchr-github c218859418
Fix some FNs related to c_str() (#4258) 2022-07-10 11:38:01 +02:00
chrchr-github f5c4a21eae
Fix #10704 FN redundantCopyLocalConst (#4115) 2022-07-10 11:33:24 +02:00
Oliver Stöneberg c9c1f83a69
use `emptyString` more consistently (#4034) 2022-07-10 10:57:29 +02:00
Oliver Stöneberg c36320747f
some `missingInclude`/`missingIncludeSystem` fixes and tests (#4027)
* do not emit `missingInclude` and `missingIncludeSystem` errors when not enabled / fixed and improved TestPreprocessor::inline_suppression_for_missing_include()

* testpreprocessor.cpp: added missing tests for `missingInclude` and `missingIncludeSystem`

* cppcheckexecutor.cpp: `missingIncludeSystem` was not emitted in normal analysis if `missingInclude` existed

* dmake

* added `run-dmake` as `testrunner` dependency
2022-07-09 23:21:11 +02:00
orbitcowboy c117f62926 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 22:36:17 +02:00
orbitcowboy 8215521843 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 19:59:16 +02:00
orbitcowboy ef47d34e75 Fixed zerodiv/moduloofone FNs for more math functions 2022-07-09 19:21:58 +02:00
orbitcowboy 0282c3a86e Fixed zerodiv/moduloofone FN for '1/std::expm1(0)' 2022-07-09 17:52:58 +02:00
orbitcowboy 07eeee1620 Fixed zerodiv FN for '1/std::exp2(0)' 2022-07-09 17:47:21 +02:00
orbitcowboy 048d31ec56 Fixed zerodiv FN for '1/std::erfc(42)' 2022-07-09 17:43:17 +02:00
orbitcowboy 87c1e6587a Fixed zerodiv FN for '1/std::erf(0)' 2022-07-09 17:38:28 +02:00
orbitcowboy c777cd5060 Fixed zerodiv FN for '1/std::ceil(0)' 2022-07-09 17:32:32 +02:00
orbitcowboy 41b6452604 Fixed zerodiv FN for '1/std::cbrt(0)' and added more test cases for other math functions 2022-07-09 17:28:15 +02:00
Paul Fultz II 6b72274c67
Evaluate math library functions in valueflow (#4255)
* Evaluate math library functions in valueflow

* Format
2022-07-09 07:40:32 +02:00
Paul Fultz II edebe746bc
Fix 10361: false negative: uninitvar (std::next(iterator)) (#4256) 2022-07-09 07:39:04 +02:00
Jens Yllman b246781da6
Try to stop range overflow in forwardRange() (#4235)
* Try to stop range overflow in forwardRange()

* Use predefinded function for check instead
2022-07-09 00:57:44 +02:00
Paul Fultz II 0b63e7273d
Fix 11162: FP: knownConditionTrueFalse (#4254)
* Fix 11162: FP: knownConditionTrueFalse

* Format
2022-07-09 00:57:25 +02:00
Oliver Stöneberg b51aea5531
separated process execution code into `ProcessExecutor` (#4249) 2022-07-08 16:42:57 +02:00
Tau c17e2b9826
Correctly interpret boolean literals in `execute()` (#4251)
* Correctly interpret boolean literals in `execute()`

* Add regeression test case for boolean literals
2022-07-08 12:39:29 +02:00
chrchr-github bd92e7411c
Fix #11163 Hang on smart pointer with auto type deduction (#4250)
* Fix #11163 Hang on smart pointer with auto type deduction

* Format

* Format
2022-07-08 12:37:53 +02:00
chrchr-github 89a9e5ecc6
Fix #9944 FP: terminateStrncpy doesn't account for size check (#4252)
* Fix #9944 FP: terminateStrncpy doesn't account for size check

* Fix container size check

* Undo

* Format

* Rebuild

* Rebuild
2022-07-08 12:35:21 +02:00
Daniel Marjamäki a71a647c39 Fix syntax error 2022-07-07 19:45:47 +02:00
Daniel Marjamäki e1d3e6f72e Catch internal error during whole program analysis 2022-07-07 19:14:18 +02:00
Daniel Marjamäki d1812c8022 Cppcheck: Write product name if provided in xml output 2022-07-07 17:35:13 +02:00
Daniel Marjamäki 68bb724dcc ErrorLogger: do not allocate huge std::string when column is -1 2022-07-07 15:07:17 +02:00
Daniel Marjamäki b888f9cf92 use hash instead of checksum to check if content is changed 2022-07-07 12:16:01 +02:00
Daniel Marjamäki 29402b4d1a Fix Coverity CID1490221 warning. settings is dereferenced and then checked. 2022-07-05 07:46:39 +02:00
Daniel Marjamäki d8239b26f1 Tokenizer: Remove simplifyCalculations from simplifyTokenList2 2022-07-04 22:54:43 +02:00
chrchr-github 22aeeb1788
Fix ClangImport crash on Windows paths (#4246)
* Fix crash on Windows paths

* Fix test

* Enable fix

* Cut trailing ':'
2022-07-02 17:43:52 +02:00
chrchr-github 596f75e2af
Fix FP compareValueOutOfTypeRangeError (#4245)
* Fix FP compareValueOutOfTypeRangeError

* Remove suppressions
2022-07-01 10:48:32 +02:00
chrchr-github 27578e9c4c
Fix FP returnStdMoveLocal (#4244) 2022-06-30 13:50:31 +02:00
chrchr-github d8e64b4cbb
Fix FP leakNoVarFunctionCall (#4243)
* Fix #10857 FN: leakNoVarFunctionCall

* Fix TODO

* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )

* #11155 FN: leakNoVarFunctionCall (ternary operator)

* Fix #11157 FN: leakNoVarFunctionCall (switch condition)

* Fix FN constStatement

* Fix FP leakNoVarFunctionCall

* Fix FP leakNoVarFunctionCall

* Format

* Fix FP leakNoVarFunctionCall with unknown function

* Fix FP leakNoVarFunctionCall
2022-06-30 13:05:28 +02:00
chrchr-github 06b408ea20
Fix FP leakNoVarFunctionCall with unknown function (#4242)
* Fix #10857 FN: leakNoVarFunctionCall

* Fix TODO

* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )

* #11155 FN: leakNoVarFunctionCall (ternary operator)

* Fix #11157 FN: leakNoVarFunctionCall (switch condition)

* Fix FN constStatement

* Fix FP leakNoVarFunctionCall

* Fix FP leakNoVarFunctionCall

* Format

* Fix FP leakNoVarFunctionCall with unknown function
2022-06-29 13:43:17 +02:00
chrchr-github b90a726441
Fix FP leakNoVarFunctionCall (#4241)
* Fix #10857 FN: leakNoVarFunctionCall

* Fix TODO

* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )

* #11155 FN: leakNoVarFunctionCall (ternary operator)

* Fix #11157 FN: leakNoVarFunctionCall (switch condition)

* Fix FN constStatement

* Fix FP leakNoVarFunctionCall

* Fix FP leakNoVarFunctionCall

* Format
2022-06-29 07:22:26 +02:00
Paul Fultz II 185294499c
Adjust the severity of the uninitvar (#4234) 2022-06-28 22:52:35 +02:00
chrchr-github f8b796403b
Fix #11146 Crash in expandTemplate() (#4238) 2022-06-28 22:43:34 +02:00
Paul Fultz II a2f2699088
Refactor alias check in isExpressionChangeAt into isAlias function (#4223) 2022-06-28 22:40:59 +02:00
chrchr-github 2223cd24b9
Fix #11157 FN: leakNoVarFunctionCall (switch condition) (#4240)
* Fix #10857 FN: leakNoVarFunctionCall

* Fix TODO

* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )

* #11155 FN: leakNoVarFunctionCall (ternary operator)

* Fix #11157 FN: leakNoVarFunctionCall (switch condition)

* Fix FN constStatement

* Fix FP leakNoVarFunctionCall
2022-06-28 14:02:02 +02:00