orbitcowboy
601ca6b3c5
Merge branch 'main' of https://github.com/danmar/cppcheck into main
2021-06-03 07:33:47 +02:00
orbitcowboy
4c81a59c0b
std.cfg: Added support for more interfaces
2021-06-03 07:33:23 +02:00
Paul Fultz II
3e78e76fe8
Fix issue 10076: ValueFlow: False positive after address of var is taken 'T t = {{{&var}}};' ( #3283 )
2021-06-03 07:31:46 +02:00
Paul Fultz II
548ec10824
Fix issue 10306: FP knownConditionTrueFalse with modulo result converted to bool ( #3282 )
2021-06-03 07:26:36 +02:00
dummyunit
9652ca39a3
Improve support for labels in simplifyAddBraces step ( #3278 )
...
Previously only a single regular label before a compound statement was
allowed in simplifyAddBracesPair() after if/switch/do/while/for.
This patch adds support for:
* case-labels;
* labels before a single statement;
* labels before try/catch blocks;
* multiple consecutive labels.
Additionally the code for skipping a case label was extracted into a
separate function from simplifyLabelsCaseDefault() and reused in
simplifyAddBracesPair().
2021-06-02 07:00:37 +02:00
Maksim Derbasov
06c4542ac2
New check for rethrow without current handled exception ( #3270 )
2021-05-31 10:39:24 +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
Robert Reif
c7be967769
fix #10295 (false negatives by inconsistent 'void' in argument list (declaration vs definition)) ( #3274 )
...
Co-authored-by: Robert Reif <reif@FX6840>
2021-05-24 19:32:15 +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
3a498de306
extracttests; do not extract TestBufferOverrunterminateStrncpy tests
2021-05-24 13:17:29 +02:00
orbitcowboy
df6b0bcd87
#10026 : Added a regression test for 'false negative: duplicateExpression'
2021-05-24 08:54:45 +02:00
Paul Fultz II
ab50a75d8a
Fix 10289: ValueFlow; Wrong known value 'size_t - uint16_t > 0' ( #3273 )
2021-05-24 08:28:21 +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
d64aea90fa
astyle formatting
2021-05-23 14:36:45 +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
dummyunit
247b2d8c83
Support array types in template simplifier ( #3267 )
2021-05-23 10:40:09 +02:00
Paul Fultz II
47a4144b47
Fix 10288: ValueFlow; False positives because of wrong known value when there is sign cast ( #3268 )
2021-05-23 10:20:29 +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
Paul Fultz II
8541e0503e
Fix 10290: false negative: container out of bounds ( #3269 )
2021-05-22 23:33:13 +02:00
Daniel Marjamäki
5f6b56ada2
buffer overrun; Fixed false negative for dynamically allocated float buffer
2021-05-22 15:39:20 +02:00
Daniel Marjamäki
87554bed7a
Redundant pointer op; Fixed false positives when macro is used
2021-05-22 14:18:29 +02:00
Daniel Marjamäki
9a9f14bd8a
Buffer overflow; Fixed FPs when array size is 1
2021-05-22 12:13:39 +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
Paul Fultz II
c63aa2f2cc
Fix 10263: FP containerOutOfBounds when container is accessed via pointer ( #3265 )
2021-05-22 08:36:51 +02:00
Maksim Derbasov
f0d1822a83
Better handling functions with try block for throwInNoexceptFunction ( #3264 )
2021-05-22 08:36:28 +02:00
Paul Fultz II
1e3ab460a3
Fix 10254: false positive: arrayIndexOutOfBounds in inline function ( #3266 )
2021-05-22 08:20:09 +02:00
Daniel Marjamäki
22ae4543a6
Fixed 'make checkcfg'
2021-05-22 07:39:27 +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
Robert Reif
3af3d7fc06
fix #10281 (Tokenizer; Wrong simplification for 'namespace ef = : 🅰️ 🅱️ :c::d::ef') ( #3263 )
2021-05-20 08:27:07 +02:00