Commit Graph

27295 Commits

Author SHA1 Message Date
chrchr-github a0b59ff56a
Fix FN constVariableReference () 2023-04-11 14:00:40 +02:00
Paul Fultz II ac14fd218b
ValueFlow: Infer possible symbolic values () 2023-04-10 19:27:29 +02:00
Daniel Marjamäki 7cded1967d misra.py: Fix mistake I saw when looking at the code 2023-04-09 18:55:47 +02:00
chrchr-github 63151f3291
Fix crash in constPointer() () 2023-04-09 16:38:09 +02:00
Daniel Marjamäki 7726a5b5b3
Add a --check-level option () 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 () 2023-04-08 22:29:09 +02:00
Oliver Stöneberg b04812b0e8
CI-unixish-docker.yml: disabled precompiled headers when using `ccache` with CMake () 2023-04-08 22:21:11 +02:00
Oliver Stöneberg cfca3a69a2
optimized template string substitutions a bit () 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 ()
* 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 () 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 () 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 () 2023-04-08 12:15:16 +02:00
Paul Fultz II 93b4de36cd
Update constVariable IDs for references and pointers () 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 Crash in TypedefSimplifier ()
* Fix  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 , FN , fix crash ()
* Fix remainig example from 

* Fix FP, new warnings

* More warnings

* Use getTokenArgumentFunction()

* Fix crash

* Fix  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 () 2023-04-06 18:45:12 +02:00
chrchr-github 1b00a0f06a
Fix Missing --check-library warning when memory leaks check assumes function is noreturn ()
* Fix  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 ()
* 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 () 2023-04-05 11:05:29 +02:00
chrchr-github 0f47948bf4
Fix FN unusedStructMember when casting address (regression) () 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 () 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 () 2023-04-04 11:37:16 +02:00
Oliver Stöneberg 9c8ebbcefc
readme.md: removed defunct (and unnecessary) GitHub Actions badge [skip ci] () 2023-04-04 07:47:05 +02:00
Paul Fultz II d5e2ee411e
Fix 11578: FP accessMoved with range-based for loop ()
* 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() ()
* Fix crash in constPointer()

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

* Adjust test

* Update testother.cpp

* Update testother.cpp

* Fix  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 
2023-04-02 20:36:23 +02:00
Paul Fultz II 634f5e254f
Fix 11512: FN containerOutOfBounds when empty vector is returned () 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 () 2023-04-01 19:58:58 +02:00
chrchr-github 7503aca0e2
Fix FP functionConst when assigning init list ()
* Fix  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 () 2023-04-01 16:33:50 +02:00
Oliver Stöneberg 5ec0ad6bed
use `ccache` for sanitizer builds / do not use precompiled headers with `ccache` ()
* 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 ()
* 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 ()
* 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 Library::getFunctionName: SIGSEGV ()
* Partial fix for  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] () 2023-03-30 07:24:58 +02:00
chrchr-github 4d72e0f5b5
Fix FP constVariable when returning by reference () 2023-03-30 07:24:36 +02:00
chrchr-github 3836367d95
Fix FN passedByValue with array access, range-based for ()
* 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 Infinite loop in ReverseTraversal () 2023-03-30 07:22:41 +02:00
chrchr-github 13e12da08f
Fix findGarbageCode(): SIGSEGV () 2023-03-28 11:24:52 +02:00
chrchr-github 7bf6b359b1
Fix false negative: functionConst () 2023-03-27 17:54:19 +02:00
chrchr-github 5791561a45
Partial fix for checkLibraryFunction warning for smartpointer in container () 2023-03-27 17:50:33 +02:00