Commit Graph

26124 Commits

Author SHA1 Message Date
Daniel Marjamäki 1d5166d70c CheckClass: Fix false negatives for uninitMemberVar 2022-06-21 19:28:08 +02:00
orbitcowboy 49ffe80f75 Decativate 'make validateRules' 2022-06-21 17:14:53 +02:00
orbitcowboy 6f303ce61c daca@home: Set '--inline-suppr' flag. 2022-06-21 16:18:12 +02:00
orbitcowboy 78804ca18c Remove <rules>...</rules>, added by 52aab1e80c which broke internal checking. In addition another internal rule was added, following up the changes from https://github.com/danmar/cppcheck/pull/4182/files 2022-06-21 16:10:50 +02:00
chrchr-github a658baf962
Fix #11143 FP: unreadVariable (remove simplifyMathExpressions()) (#4227)
* Fix #11143 FP: unreadVariable (remove simplifyMathExpressions())

* Remove unused function, tests
2022-06-21 15:42:23 +02:00
chrchr-github 0d4b4394bb
Fix FP with embedded zeros (#4226)
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument

* Typo

* Remove <strz>, suppressions

* Add suppresion, remove <strz>

* Add suppressions

* Fix FP with embedded zeros

* Merge
2022-06-21 13:33:45 +02:00
chrchr-github de2509f1ac
Fix FP with complex array size expression (#4225)
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument

* Typo

* Remove <strz>, suppressions

* Add suppresion, remove <strz>

* Add suppressions

* Fix FP with complex array size expression
2022-06-21 00:12:11 +02:00
chrchr-github 5b9fa9657d
Partial fix for #11137 FN: invalidFunctionArgStr printf argument (#4224)
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument

* Typo

* Remove <strz>, suppressions

* Add suppresion, remove <strz>

* Add suppressions
2022-06-20 20:02:22 +02:00
orbitcowboy ff50a01d36 Fixed handling of PCRE rules, since 'simple' rules have been removed already, set default to 'normal'-tokenlist. 2022-06-20 09:17:11 +02:00
Paul Fultz II 6843bf628b
Use the correct test name for SKIP_TESTS (#4221) 2022-06-19 19:26:49 +02:00
Daniel Marjamäki 0835250d7f writing-addons.md: small tweaks 2022-06-19 19:18:52 +02:00
Daniel Marjamäki b6a364eda4 man: Added writing-addons.md 2022-06-19 12:23:29 +02:00
orbitcowboy ee85de5ac3 posix.cfg: Improved configuration by adding some missing 'baseType'-attributes 2022-06-19 12:12:32 +02:00
orbitcowboy a200c15370 Merge branch 'main' of https://github.com/danmar/cppcheck 2022-06-19 12:04:29 +02:00
orbitcowboy dfbc4afc59 Mentioned changes from LCppC in release notes: 9eb16e1002. 2022-06-19 12:03:08 +02:00
PKEuS 9eb16e1002
Replaced check for pipe() buffer size by ordinary CheckBufferOverrun, provide required Library configuration option (#4183)
Merged from LCppC.
2022-06-19 12:01:55 +02:00
Daniel Marjamäki 6873f5237b Tokenizer: removing more stuff from simplifyTokenList2 2022-06-19 10:41:15 +02:00
orbitcowboy 3dcdd5f264 std.cfg: Added a TODO test case 2022-06-19 10:13:22 +02:00
Paul Fultz II e735376f7d
Refactor to use AST for isContainerSizeChanged (#4222) 2022-06-19 08:17:05 +02:00
Paul Fultz II e6fdcb9de2
Refactor to use derefShared (#4220) 2022-06-19 08:16:27 +02:00
Paul Fultz II 2a0b2f538e
Check tokType in match compiler (#4219)
* Check tokType in match compiler

* Set keyword when tokenlist is missing
2022-06-18 21:30:42 +02:00
Daniel Marjamäki a7815ed5b0 Tokenizer: Remove more stuff from simplifyTokenList2 2022-06-18 07:31:36 +02:00
Daniel Marjamäki aa8c17a701 Tokenizer: remove stuff from simplifyTokenList2 2022-06-17 09:44:58 +02:00
Paul Fultz II 3612ddb3f5
Fix unit test failure (#4218) 2022-06-17 07:49:45 +02:00
Daniel Marjamäki 968d8d153e Fixed #11101 (False positive: derived union members are initialized in constructor) 2022-06-16 20:17:57 +02:00
Paul Fultz II 3e09503561
Fix 11087: false negative: usage of reference to member of temporary object not detected (#4217)
* Fix 11087: false negative: usage of reference to member of temporary object not detected

* Format

* Add another test case

* Fix FP with pointer

* Format
2022-06-16 19:26:36 +02:00
Paul Fultz II 9cecc8468e
Fix 10570: Improve check; condition then pointer dereference, different pointers (#4216)
* Try to use after assign in loop

* Update valueflow forward to handle init tokens

* Fix tests

* Make test TODO

* Format

* Add tests

* Format

* Fix ubsan error

* Use simpleMatch
2022-06-16 19:26:23 +02:00
Paul Fultz II de51ebbcf4
Fix 9135: Access of moved variable not detected in loop (#4215)
* Fix 9135: Access of moved variable not detected in loop

* Format

* Fix issue with pushing back on container

* Format

* Fix null pointer

* Remove yeild for now
2022-06-16 17:40:09 +02:00
Daniel Marjamäki ef33ff628f cppcheckdata.py: fix cmd_output() function, handle errors better 2022-06-16 14:07:14 +02:00
Daniel Marjamäki dbb12cb333 Tokenizer: Remove some functions from simplifyTokenList2 2022-06-16 14:06:07 +02:00
Daniel Marjamäki a2b50c1ccf ci: fix syntax error in scriptcheck.yml 2022-06-16 10:28:55 +02:00
Daniel Marjamäki 7999808639 ci: disable pylint because it fails to import files 2022-06-16 09:09:44 +02:00
Paul Fultz II 46fcdca5ee
Add debug_valuetype intrinsic (#4210) 2022-06-15 21:25:55 +02:00
Daniel Marjamäki 9e31d6d05d Revert "cppcheckdata.py: better handling when subprocess call fails"
This reverts commit 1cc3b46d32.
2022-06-15 19:38:40 +02:00
Daniel Marjamäki 1cc3b46d32 cppcheckdata.py: better handling when subprocess call fails 2022-06-15 17:13:14 +02:00
chrchr-github 176eefcbf3
Fix #10655 FN bitwiseOnBoolean with unseen function (#4214) 2022-06-14 23:08:17 +02:00
chrchr-github de9b65c737
Add tests for #9194, #10415, #4759, #9876, #10006 (#4213)
* Add test for #10152

* Add test for #9773

* Fix test

* Add test for #7529

* Add test for #6371

* Add test for #6475

* Format

* Format

* Fix test

* Remove duplicate test

* Add valueflow test

* Rebuild

* Add tests for #9194, #10415, #4759, #9876, #10006
2022-06-14 13:05:07 +02:00
chrchr-github 6d22d6a8ae
Fix FP unusedVar with side effects in destructor (#4212) 2022-06-14 09:55:22 +02:00
chrchr-github 6f5a5fd947
Add some tests (#4211)
* Add test for #10152

* Add test for #9773

* Fix test

* Add test for #7529

* Add test for #6371

* Add test for #6475

* Format

* Format

* Fix test

* Remove duplicate test

* Add valueflow test

* Rebuild
2022-06-14 09:54:45 +02:00
Daniel Marjamäki 343d04feb4 Tokenizer: Remove simplifyCharAt from simplifyTokenList2 2022-06-12 15:14:48 +02:00
WinterSolstice8 8e4da32594
Update manpage to fix typo in --max-ctu-depth cli option. (#4206) 2022-06-12 11:09:41 +02:00
Daniel Marjamäki 8255e32540 cppcheck build dir: do not produce invalid dump file if code is unchanged and checking is skipped. 2022-06-12 11:08:28 +02:00
Paul Fultz II d4fb5652c0
Fix 10619: Valueflow: Library function in subfunction does not propagate all values (#4209) 2022-06-12 07:17:28 +02:00
Paul Fultz II bd63534a1c
Fix 10740: valueflow; conditional value. incremented value is oob. (#4208) 2022-06-12 07:16:28 +02:00
Paul Fultz II cee48e5e19
Add backtrace to valueflow in debug mode (#4195) 2022-06-12 07:13:42 +02:00
Rikard Falkeborn 187460a277
Library: Replace auto with real types (#4207)
Following up on fc6c203b0e, replace auto with the correct types to
clairfy the code. Note the use of const on the first type in the pair,
which allows us to use a reference.
2022-06-11 23:21:25 +02:00
chrchr-github ecb24e28bc
Fix #10191 FP redundantCopyLocalConst - referenced variable changes (#4202) 2022-06-11 16:58:33 +02:00
PKEuS cb382ac52c
C++20 support: Support consteval and constinit (#4203)
Backported from LCppC.
2022-06-11 15:28:20 +02:00
Rikard Falkeborn fc6c203b0e
Library: Use range-based for loops (#4200) 2022-06-11 13:51:55 +02:00
Paul Fultz II 8945c151f5
Fix 11124: FP knownConditionTrueFalse with fruit (#4196)
* Update valueType

* Allow comparisons

* Fix compare op

* Add test

* Format

* Fix FP

* Format
2022-06-11 11:02:04 +02:00