Commit Graph

635 Commits

Author SHA1 Message Date
chrchr-github b4c90f8b2a
Fix #11597 FP uninitvar with nested enum (#4847) 2023-03-04 11:57:12 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1d3955bd92
renamed some files in the `test` folder (#4705) 2023-01-27 08:18:32 +01:00
Oliver Stöneberg fd15811215
de-coupled `--check-library` from `information` severity and other dependencies (#3861) 2023-01-26 22:28:04 +01:00
chrchr-github a79dff15ab
Fix #11492 FP uninitvar with try/catch (#4711) 2023-01-14 20:14:38 +01:00
chrchr-github f793b7dd35
Fix #11460 unintvar false positive (#4674)
* Fix #11460 unintvar false positive

* Format
2023-01-02 17:44:52 +01:00
Paul Fultz II 7acbb656f3
Fix 11412: False positive: uninitvar (#4624)
* Dont remove modified variables from dead code

* Add test for 11412

* Format
2022-12-09 07:15:47 +01:00
chrchr-github 89dba226dd
Fix #11305 FP uninitvar with unseen typedef (#4612) 2022-12-07 09:14:22 +01:00
chrchr-github 6c24d2b865
Fix #11321 FP uninitvar for in-class member initialization (#4547) 2022-10-14 19:48:27 +02:00
chrchr-github 31118fdce5
Fix noreturn FP with while() (#4429)
* 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
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
Paul Fultz II 185294499c
Adjust the severity of the uninitvar (#4234) 2022-06-28 22:52:35 +02:00
chrchr-github 11860cce4b
Add test for #10463 (#4231)
* Add test for #10643

* Comment

* Fox comment
2022-06-24 13:55:04 +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
chrchr-github ad547af6f9
Add tests for #6323, #6855, #6857 (#4096)
* Add tests for #6870, #10749

* Add test for #6372

* Add tests for #6855, #6857

* Add test for #6323

* Comment
2022-05-10 18:25:01 +02:00
chrchr-github adba751217
Fix #11018 FP uninitvar with redundant pointer op (#4082)
* Skip redundant pointer op

* Fix  #11018 FP uninitvar with redundant pointer op

* Format
2022-05-05 06:54:27 +02:00
Paul Fultz II 496b45f27b
Fix 11009: FP uninitvar (#4076)
* Fix 11009: FP uninitvar

* Format
2022-05-04 05:59:01 +02:00
Paul Fultz II aafd1e10be
Fix 11006: FP uninitvar with unknown constant (#4056) 2022-04-28 10:48:37 +02:00
chrchr-github 6df0f9b3e3
Add tests for #7377, #8692, #9180 (#4053) 2022-04-27 12:43:21 +02:00
orbitcowboy bb98ccf7d4 Ticket #9313 - Added a regression test 2022-04-26 07:45:08 +02:00
chrchr-github 1bc0317719
Fix #11002 FP uninitStructMember with extra parentheses (#4047) 2022-04-25 22:22:35 +02:00
Paul Fultz II 6b9ac6f7a8
Warn when incrementing uninitialized value (#4042)
* Warn when incrementing uninitialized value

* Format
2022-04-24 09:56:58 +02:00
Paul Fultz II 3feecc51d6
Fix 10988: FP: Regression, uninitvar (#4037) 2022-04-21 19:29:38 +02:00
Paul Fultz II d97942d3c6
Fix 6577: Detect pointer to uninitialised memory with clock_settime() (#3993)
* Fix 6577: Detect pointer to uninitialised memory with clock_settime()

* Format
2022-04-11 07:23:44 +02:00
Paul Fultz II 5bea50cd36
Fix 10908: FP: uninitvar after for-loop (#3942) 2022-03-31 21:24:20 +02:00
chrchr-github 948bb8df94
Add test for #10089, #10280 (#3958) 2022-03-30 15:49:45 +02:00
Paul Fultz II 21b8c36eb1
Fix 10916: FP: uninitvar (#3949) 2022-03-27 10:01:58 +02:00
chrchr-github 479af21405
Fix #10698 FP uninitvar with new and braced initializer (#3934) 2022-03-24 20:08:51 +01:00
Paul Fultz II 4b4037540a
valueFlowUninit: Handle arrays and pod types (#3917)
* valueFlowUninit: Handle arrays and pod types

* Format

* Catch another array case
2022-03-24 06:35:44 +01:00
chrchr-github 1aff160411
Fix #9303 FP uninitvar after lambda expression (#3903)
* Fix #9303 FP uninitvar after lambda expression

* Format
2022-03-15 14:32:33 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly (#3767) 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
chrchr-github 2b13a27140
Fix #9696 FP uninitdata - writing pointer to stream (#3772) 2022-02-02 12:24:32 +01:00
chrchr-github c74eeb6bad
Fix FN uninitVar with std::array (#3707) 2022-01-27 19:45:27 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
chrchr-github f49cfcd23c
Fix #10200 False positive: uninitStructMember (#3741) 2022-01-25 12:14:20 +01:00
Oliver Stöneberg 55ff684f34
added unusedFunction self check to CI / cleanups (#3526) 2022-01-18 22:02:25 +01:00
chrchr-github 9c56e7ea8d
Fix #6475 FN uninitialized variable usage not detected (#3700) 2022-01-17 20:35:30 +01:00
chrchr-github 12abf85d1d
Add test case for #5777, use TODO_ASSERT, enable test case (#3703)
* Add test case for #5777, use TODO_ASSERT, enable test case

* Comment
2022-01-13 19:52:02 +01:00
Paul Fultz II 0c9eb5d190
Fix 10681: FP ctuuninitvar with array member (#3686) 2022-01-08 10:47:28 +01:00
KenPatrickLehrmann af289c8357
Handle (&foo)-> in isVariableChanged (#3624) 2022-01-02 08:14:10 +01:00
Paul Fultz II d36aa590cd
Fix 10553: FP uninitvar with strcpy (#3652) 2021-12-23 08:22:41 +01:00
Paul Fultz II 332f4c205a
Fix 9772: FP uninitvar: in cppcheck 2.1 (#3638) 2021-12-17 21:51:47 +01:00
Oliver Stöneberg ba402f3e50
cleaned up includes based on include-what-you-use (#3627) 2021-12-15 19:47:27 +01:00
chrchr-github ca311ebcdf
ASSERT() on calls to Tokenizer::tokenize() in test code (#3501) 2021-11-29 07:34:39 +01:00
chrchr-github 629f883408
Fix #10097: autovarInvalidDeallocation with pointer to std::array (#3529) 2021-11-08 20:31:16 +01:00
Paul Fultz II 1791457227
Fix 9953: false positive: uninitvar (#3548) 2021-11-07 06:51:19 +01:00
Paul Fultz II ffc2a9d8e2
Fix 9735 for valueFlowUninit (#3538) 2021-11-06 19:06:07 +01:00
orbitcowboy bd63882d80 testuninitvar: #9735 - Moved test to valueFlowUninit. 2021-10-31 07:14:00 +01:00
Paul Fultz II 8c9c46835a
Fix for 6597: false negative: uninitialized variable usage not detected (ValueFlow , multi variables) (#3535) 2021-10-30 22:13:58 +02:00
orbitcowboy 242acb6135 testuninitvar: Moved test into CTU section. 2021-10-30 17:07:52 +02:00
orbitcowboy be2ba0f772 Ticket #9735 - Added regression test 2021-10-30 16:31:59 +02:00
Paul Fultz II e20ddd55d6
Propagate partially uninit variables in ValueFlow (#3533) 2021-10-30 07:43:37 +02:00
Paul Fultz II ca83222bae
Add subexpression analyzer to set values for uninitialized members of struct (#3517)
* Add subexpression analyzer

* Fix errors

* Add tests

* Format

* Add more tests

* Run members first

* Format

* Uncomment todo assert

* Formatting

* Use simpleMatch
2021-10-21 14:44:48 +02:00
Paul Fultz II 257efb4019
Check if uninit value is used in library function (#3516) 2021-10-20 20:51:59 +02:00
orbitcowboy 9c16f13651 Format 2021-10-16 00:31:55 +02:00
orbitcowboy d4a98dfaab Ticket #4716: Added a regression test 2021-10-15 22:50:29 +02:00
Paul Fultz II 2ca2abdf0e
Remove duplicate uninit warnings (#3478) 2021-10-04 07:50:23 +02:00
Daniel Marjamäki eb50d19657 Uninitvar: Moved testcases for avoiding extra warnings from TestValueFlow to TestUninitVar 2021-10-03 22:15:35 +02:00
Daniel Marjamäki 6a1b7f53ce Fixed CI 2021-10-03 18:47:21 +02:00
Paul Fultz II 9e9a982c6c
Fix 10468: False positive; uninitialized variable. Loop is always executed at least once (#3462) 2021-09-18 22:23:05 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
orbitcowboy 7d7241b076 #9772: FP uninitvar: in cppcheck 2.1; Added a regression to test 2021-07-06 14:24:07 +02:00
Paul Fultz II fb9d659e25
Fix 10326: Regression: ValueFlow; Wrong Uninit value after do while (#3312) 2021-07-03 09:12:26 +02:00
Daniel Marjamäki 1a5449cbeb Fixed #10327 (ValueFlow; Wrong Uninit value in called function) 2021-07-01 22:08:00 +02:00
Paul Fultz II eb7b225fc1
Fix 10119: ValueFlow; object member is not uninitialized. happens when there is static member also. (#3299) 2021-06-19 13:58:18 +02:00
Daniel Marjamäki a994bd5ba5 Uninitialized variables; Add todo test case 2021-05-28 18:09:43 +02:00
Paul Fultz II 5f0fe1dfe7
Fix another FP with range for macro (#3276) 2021-05-26 04:52:55 +02:00
Daniel Marjamäki a4653a057a Uninitialized variables; Fixed FP for range for loop 2021-05-25 20:37:22 +02:00
Daniel Marjamäki 7d84b8f1bc Uninitialized variables; Fix FP when assigning struct members 2021-05-25 16:13:32 +02:00
Daniel Marjamäki 8d97cce81b Uninitialized variables; Added true positive test 2021-05-25 07:31:01 +02:00
Daniel Marjamäki 4cccc710ef Uninitialized variables; Fixed FP when bitmask is used on address 2021-05-24 20:55:13 +02:00
Daniel Marjamäki d3bb84cd0e Uninitialized variables; Added TP tests for ignored operators 2021-05-24 17:53:16 +02:00
Daniel Marjamäki b7803ea6fb Uninitialized variables; Fixed false positives for reference cast and dereferencing address of uninitialized variable 2021-05-24 17:50:28 +02:00
Daniel Marjamäki 4ad90bf6f1 Uninitialized variables; Fixed FP in inner for loop 2021-05-24 17:02:19 +02:00
Daniel Marjamäki fa72ec20b2 Uninitialized variables; avoid false positives when passing uninitialized variable to unknown function 2021-05-24 15:54:09 +02:00
Daniel Marjamäki a2e709a652 Uninitialized variables; Try to remove heuristics for assignment with overloaded <<. That is non-standard behavior for the << operator. Let's see how much FPs we get. 2021-05-24 13:17:50 +02:00
Daniel Marjamäki 8ad0905e3b Uninitialized variables; Fixed FP in valueflow-based checking 2021-05-23 18:43:34 +02:00
Daniel Marjamäki f968761382 Uninitialized variables; Remove TODO comment in test, test is working as it should now. 2021-05-23 14:57:43 +02:00
Daniel Marjamäki 8828619855 Fixed #10293 (Uninitialized variables; False positive for array in union) 2021-05-23 12:06:23 +02:00
Daniel Marjamäki 85723f8605 Uninitialized variables; Different heuristic needed for const pointer function parameter 2021-05-23 11:45:47 +02:00
Paul Fultz II e2d9aaf23b
Fix 10286: false positive: uninitvar (#3271)
* Fix 10286: false positive: uninitvar

* Remove header
2021-05-23 07:58:19 +02:00
Daniel Marjamäki 1cb48ad418 Uninitialized variables; Fixed false positive in sizeof() 2021-05-22 11:04:42 +02:00
Daniel Marjamäki f5f3a8d4d7 Fix syntax errors in test cases 2021-05-22 09:44:18 +02:00
Daniel Marjamäki 68c46e146d Uninitialized variables; Fixed FP when returning malloc pointer 2021-05-21 17:10:49 +02:00
Daniel Marjamäki 2d3d7db730 Uninitialized variables; fix syntax errors in test cases 2021-05-21 15:30:52 +02:00
Daniel Marjamäki 1e6a574cff Uninitialized variables; Passing address of uninitialized variable to function 2021-05-21 15:27:13 +02:00
Daniel Marjamäki 8adfcc848c Uninitialized variables; check RHS expression 2021-05-21 14:31:25 +02:00
Daniel Marjamäki cc74c8e1da Uninitialized variables; Moved test case. ValueFlow can detect issue. 2021-05-21 10:42:58 +02:00
Paul Fultz II 5409fa8afd
Fix disabled valueFlowUninit tests (#3262) 2021-05-21 07:28:34 +02:00
Daniel Marjamäki 4746d4b819 Uninitialized variables; Improved checking of loops 2021-05-20 22:56:14 +02:00
Daniel Marjamäki 8e650e4243 Uninitialized variable; Fixed FP after unconditional scope with conditional initialization 2021-05-20 18:38:59 +02:00
Daniel Marjamäki f1fff5e904 Fixed #10279 (ValueFlow/TokenList: function pointer dereference and call) 2021-05-20 13:54:17 +02:00
orbitcowboy ef757e5cf9 #6952: uninitvar - Added regression test cases 2021-05-20 09:14:17 +02:00
Daniel Marjamäki ca5fab8219 Uninitialized variables; Fixed false positive in range for loop 2021-05-19 21:12:11 +02:00
Daniel Marjamäki abe810d718 Uninitialized variables; Fix false positive in switch inside loop 2021-05-19 13:07:04 +02:00
Daniel Marjamäki e35c46bcb9 Uninitialized variables; Fixed false positive for overloaded & 'ar & a & b & c' 2021-05-18 21:03:43 +02:00
Daniel Marjamäki 0aebc32ae0 Uninitialized variables; Fixed false positive for 'cin >> x[0]' 2021-05-18 20:13:27 +02:00
Daniel Marjamäki bde8b4316e Uninitialized variables; Fixed FP in range based for loop 2021-05-17 13:31:16 +02:00
Daniel Marjamäki 4322311482 Uninitialized variables; Fixed struct member access FP 2021-05-17 11:50:31 +02:00