Commit Graph

27041 Commits

Author SHA1 Message Date
Daniel Marjamäki 7726a5b5b3
Add a --check-level option (#4942) 2023-04-09 13:48:13 +02:00
Daniel Marjamäki 3eeeaeffd2 Tokenizer::simplifyTypedef: ensure externC flag is preserved when simplifying typedefs 2023-04-09 09:38:12 +02:00
Oliver Stöneberg f5e51eace7
do not use string-to-integer conversions without error handling (#4906) 2023-04-08 22:29:09 +02:00
Oliver Stöneberg b04812b0e8
CI-unixish-docker.yml: disabled precompiled headers when using `ccache` with CMake (#4943) 2023-04-08 22:21:11 +02:00
Oliver Stöneberg cfca3a69a2
optimized template string substitutions a bit (#4840) 2023-04-08 22:19:52 +02:00
Oliver Stöneberg 1f2b49142e
extracted single job execution into `SingleExecutor` / improved testing / do not unconditionally apply colors to output (#4882)
* added `Settings::useSingleJob()` and use it instead of checking `jobs` or `jointSuppressionReport`

* extracted single job execution into `SingleExecutor`

* moved `reportStatus()` from `CppCheckExecutor` to Èxecutor

* TestSingleExecutor: improved tests

* added testing of markup extension handling in executors

* cleaned up includes based on `include-what-you-use`

* testsingleexecutor.cpp: suppress `performance-unnecessary-value-param` clang-tidy warnings

* ProcessExecutor: send color via pipe instead of applying it beforehand

* do not unconditionally apply colors to output / disable all colors in tests / adjusted tests for changed output behavior

* fixed precision loss in `Executor::reportStatus()`

* fixed `naming-varname` selfcheck warnings
2023-04-08 18:06:38 +02:00
Oliver Stöneberg ba168474f2
split `templateInstantiation` from `debug` warnings (#4933) 2023-04-08 16:50:11 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes (#4885) 2023-04-08 16:08:47 +02:00
Daniel Marjamäki 89a95ddc8f --performance-valueflow-max-if-count: review comments 2023-04-08 13:07:28 +02:00
Oliver Stöneberg 39f94f32f9
valueflow.cpp: fixed selfcheck suppression (#4940) 2023-04-08 12:15:16 +02:00
Paul Fultz II 93b4de36cd
Update constVariable IDs for references and pointers (#4904) 2023-04-07 20:14:53 +02:00
Daniel Marjamäki f52c00c3a7 fixed CI. I remove dump files in cppcheck build dir after analysis. 2023-04-07 19:02:34 +02:00
chrchr-github 5524bb4e58
Fix #11634 Crash in TypedefSimplifier (#4938)
* Fix #11634 Crash in TypedefSimplifier

* Call function

* Format
2023-04-07 11:09:13 +02:00
Daniel Marjamäki 1ac6c3e2ea remove dump files in cppcheck build dir after usage 2023-04-07 11:07:43 +02:00
Daniel Marjamäki 0d6575da15 gui: improved error message when project import fails 2023-04-06 21:38:12 +02:00
Daniel Marjamäki aa73427699 cleanup ctu-info when project import is used 2023-04-06 20:17:19 +02:00
chrchr-github ab24e3a3c8
Fix remaining example from #11599, FN #11646, fix crash (#4929)
* Fix remainig example from #11599

* Fix FP, new warnings

* More warnings

* Use getTokenArgumentFunction()

* Fix crash

* Fix #11646 constParameter not reported with "const * const" parameter

* Fix test

* Fix new warnings

* Add suppression

* Add const, fix suppression
2023-04-06 18:46:45 +02:00
chrchr-github 8043930a0f
Fix FN uninitMemberVar with std::array (#4935) 2023-04-06 18:45:12 +02:00
chrchr-github 1b00a0f06a
Fix #9279 Missing --check-library warning when memory leaks check assumes function is noreturn (#4937)
* Fix #9279 Missing --check-library warning when memory leaks check assumes function is noreturn

* Format

* Fix check, add tests

* Format
2023-04-06 18:44:03 +02:00
Paul Fultz II e22a740f0c
Fix 11647: FN knownConditionTrueFalse with strings of same length (#4936)
* Fix 11647: FN knownConditionTrueFalse with strings of same length

* Format

* Remove extra size

* Use simpleMatch
2023-04-06 18:42:24 +02:00
Daniel Marjamäki 47fdd1e1e3 bump simplecpp 2023-04-05 21:17:48 +02:00
Paul Fultz II edfdfe658a
Fix 11651: FP negativeIndex with for loop (#4934) 2023-04-05 11:05:29 +02:00
chrchr-github 0f47948bf4
Fix #11577 FN unusedStructMember when casting address (regression) (#4816) 2023-04-04 21:57:09 +02:00
Paul Fultz II 115f17cfe6
ValueFlow: Improve the starting point for uninitialized variables to find more uninitialized usages after many conditionals (#4930) 2023-04-04 21:55:09 +02:00
Oliver Stöneberg 16a9f54977
donate-cpu-server.py: only use more precise timestamp for logging - will unbreak "Time" columns and stale report (#4909) 2023-04-04 11:37:16 +02:00
Oliver Stöneberg 9c8ebbcefc
readme.md: removed defunct (and unnecessary) GitHub Actions badge [skip ci] (#4923) 2023-04-04 07:47:05 +02:00
Paul Fultz II d5e2ee411e
Fix 11578: FP accessMoved with range-based for loop (#4931)
* Fix 11578: FP accessMoved with range-based for loop

* Format
2023-04-03 19:44:47 +02:00
chrchr-github 86efca28a3
Fix crash in constPointer() (#4932)
* Fix crash in constPointer()

* Format
2023-04-03 19:44:08 +02:00
chrchr-github b2b0962067
Fix #11629 debug: Scope::checkVariable found variable 'np' with varid 0. (#4915) 2023-04-03 15:41:19 +02:00
chrchr-github a336048d14
Fix #11599 false negative: constParameter (#4902)
* Partial fix for #11599 false negative: constParameter

* Adjust test

* Update testother.cpp

* Update testother.cpp

* Fix #11599 false negative: constParameter

* Fix new warnings

* Format

* Add difference_type

* Remove isAliased()

* Undo

* Adjust test

* Add test

* Improve const check

* Tweak constness, add tests

* Add tests

* Use new helper function, fixtest

* Remove bailout, fix check for cast

* Prevent FP

* Fix constVariable check, add tests

* Format

* Format

* Add test for #11632
2023-04-02 20:36:23 +02:00
Paul Fultz II 634f5e254f
Fix 11512: FN containerOutOfBounds when empty vector is returned (#4928) 2023-04-02 11:58:04 +02:00
Daniel Marjamäki 2359b9ff82 valueflow: limit valueflow in functions that have many ifs 2023-04-01 20:58:15 +02:00
Oliver Stöneberg eb0998dc2c
testclass.cpp: fixed compilation (#4927) 2023-04-01 19:58:58 +02:00
chrchr-github 7503aca0e2
Fix #11621 FP functionConst when assigning init list (#4895)
* Fix #11621 FP functionConst when assigning init list

* Add comment

* Merge
2023-04-01 18:54:26 +02:00
ericLemanissier cf280f84d4
qt: fix Q_UNUSED macro defintion (#4925) 2023-04-01 16:33:50 +02:00
Oliver Stöneberg 5ec0ad6bed
use `ccache` for sanitizer builds / do not use precompiled headers with `ccache` (#4910)
* added CMake option `DISABLE_DMAKE` to disable `run-dmake` dependencies

* tools/CMakeLists.txt: added TODO

* use `ccache` for sanitizer builds

* aligned selfcheck between sanitizer workflows and disabled some currently unnecessary steps

* CI-unixish.yml: do not use precompiled headers with `ccache`
2023-04-01 09:40:10 +02:00
chrchr-github 01a22159b8
Fix autoNoType with std::begin() / function returning smart ptr (#4919)
* Fix autoNoType with std::begin()

* Suppress warning for const lambda

* Fix autoNoType with function returning smart ptr

* Handle more complex expression

* Fix scope with auto and smart ptr

* Handle smart pointers and iterators first
2023-04-01 09:38:40 +02:00
Oliver Stöneberg cb915085ea
use C++17 when building with Visual Studio in CMake - fixes GUI CI builds (#4924)
* use C++17 when building with Visual Studio in CMake

* printInfo.cmake: print more variables

* CMakeLists.txt: set C++ standard earlier
2023-03-31 10:37:53 +02:00
chrchr-github 89ec148199
Partial fix for #11638 Library::getFunctionName: SIGSEGV (#4920)
* Partial fix for #11638 Library::getFunctionName: SIGSEGV

* Fix test

* simpleMatch()
2023-03-30 07:25:26 +02:00
Oliver Stöneberg 28ed9d30e0
readme.md: rewrote `Packages` section [skip ci] (#4918) 2023-03-30 07:24:58 +02:00
chrchr-github 4d72e0f5b5
Fix #11625 FP constVariable when returning by reference (#4921) 2023-03-30 07:24:36 +02:00
chrchr-github 3836367d95
Fix FN passedByValue with array access, range-based for (#4922)
* Fix FN passedByValue with array access, range-based for

* Format

* Fix/suppress new warnings
2023-03-30 07:24:23 +02:00
chrchr-github fc24f760cc
Fix #11627 Infinite loop in ReverseTraversal (#4916) 2023-03-30 07:22:41 +02:00
chrchr-github 13e12da08f
Fix #11639 findGarbageCode(): SIGSEGV (#4917) 2023-03-28 11:24:52 +02:00
chrchr-github 7bf6b359b1
Fix #11616 false negative: functionConst (#4887) 2023-03-27 17:54:19 +02:00
chrchr-github 5791561a45
Partial fix for #11543 checkLibraryFunction warning for smartpointer in container (#4900) 2023-03-27 17:50:33 +02:00
Daniel Marjamäki c79d859f8b Tokenizer::simplifyTypedef: new faster simplification.
It performs a more "lightweight" simplification of global typedefs that are not shadowed.

If a "heavy" simplification is needed that will be executed afterwards.
2023-03-26 17:16:45 +02:00
Oliver Stöneberg 03214c6c08
testnullpointer.cpp: restored TODO assert in `nullpointerStdStream` (#4914) 2023-03-26 16:18:44 +02:00
Oliver Stöneberg f002429a6b
testrunner: fail if `TODO_ASSERT_*` succeeds (#4911)
* testrunner: fail if TODO succeeds

* testnullpointer.cpp: removed TODO from assert in `nullpointerStdStream`
2023-03-26 15:13:07 +02:00
Paul Fultz II 7231d1cece
Update the isVariableChanged to correctly check the const bit (#4912) 2023-03-26 15:12:49 +02:00