Commit Graph

259 Commits

Author SHA1 Message Date
Daniel Marjamäki 45eb9f82a0 Fix CI; Cppcheck find some more unusedAllocatedMemory violations in test/cfg/.. 2021-05-13 23:08:58 +02:00
Daniel Marjamäki d549770b5b updated extracttests.py. fix syntax errors in test cases. 2021-05-13 20:21:02 +02:00
Daniel Marjamäki d2d2124238 Revert "Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again."
This reverts commit 207361b174.
2021-04-30 16:47:02 +02:00
Daniel Marjamäki 207361b174 Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again. 2021-04-21 18:59:48 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
PKEuS 141d2ac215 Refactorization: Improved internal implementation of severity and certainty levels
Backported from LCppC.
2021-02-24 22:00:06 +01:00
IOBYTE 4e1ff86bb2
use nonneg int for varid and exprid (#3085) 2021-01-27 19:49:13 +01:00
Oliver Stöneberg ac7647fcd8
some self-check suppression cleanups (#3032) 2021-01-09 20:32:38 +01:00
miltolstoy ee8d5b972a
checkunusedvar: handle array element change using pointer arithmetic (#3000) 2021-01-01 08:06:20 +01:00
Daniel Marjamäki 1744cbaf66 astyle formatting
[ci skip]
2020-12-19 08:56:46 +01:00
miltolstoy 6366a577f9
feat(unused_var): analyze global variables inside function body (#2944) 2020-12-19 08:55:19 +01:00
Daniel Marjamäki 484b68c550 astyle formatting 2020-11-28 05:52:35 +01:00
Daniel Marjamäki ad0eb6108b Attempt to fix crashes when variable valueType is nullptr. This can happen when decltype is used on unknown type 2020-11-27 16:45:26 +01:00
miltolstoy 5d299016f1
feat: analyze function side effects (#2901) 2020-11-26 17:34:42 +01:00
Daniel Marjamäki 05514950af astyle formatting
[ci skip]
2020-10-25 07:12:30 +01:00
miltolstoy d55874ec37
checkunusedvar: handle initialization list (#2836) 2020-10-25 07:11:45 +01:00
Daniel Marjamäki 6de91d6386 Fixed #9707 (False positive: unreadVariable, union) 2020-10-02 20:22:22 +02:00
Daniel Marjamäki ba84303501 Fixed #9680 (false positive: style: Variable 'x' is assigned a value that is never used with smart pointers) 2020-09-27 19:15:15 +02:00
Daniel Marjamäki 7bb82c5df7 Fixed #9901 (False positive: variable is assigned value that is not used 'if (--N == 0)') 2020-09-26 22:13:05 +02:00
Oliver Stöneberg 7189b303ae
fixed some modernize-loop-convert clang-tidy warnings (#2815) 2020-09-21 19:30:47 +02:00
shaneasd 53a0760fdf
Improve ast generation for templated function parameters (#2803) 2020-09-14 18:44:50 +02:00
Daniel Marjamäki a11a0e79e4 Fixed Cppcheck internal warning 2020-07-23 18:54:40 +02:00
Daniel Marjamäki 682a6d1c02 Fixed #9017 (Simple classes without side effects not reported as unused) 2020-07-23 11:10:08 +02:00
Daniel Marjamäki 0583763cc6 Fixed #3088 (False positive: Dont report "struct or union member is never used" for structs with __attribute__((packed)) or #pragma pack(push)) 2020-06-30 11:00:40 +02:00
Oliver Stöneberg 4f68d85633
optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
Oliver Stöneberg 37bc0483a4
made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
Daniel Marjamäki 08ddd84780 Update copyright year 2020-05-10 11:16:32 +02:00
Daniel Marjamäki 3e0218299b Revert "Update copyright year"
This reverts commit 6eec6c4bd5.
2020-05-10 11:13:05 +02:00
Daniel Marjamäki 6eec6c4bd5 Update copyright year 2020-05-10 11:11:34 +02:00
Oliver Stöneberg 1af959af2c
fixed -Wextra-semi-stmt Clang warnings (#2553)
* fixed -Wextra-semi-stmt Clang warnings

* adjusted REDIRECT macro to require a semicolon

* testmathlib.cpp: rolled back accidental change
2020-04-21 17:27:51 +02:00
Daniel Marjamäki 2f5e585e59 astyle formatting
[ci skip]
2020-04-13 12:52:00 +02:00
shaneasd 82c09f243b
Maybeunusedsupport (#2570)
* Add rudimentary support for [[maybe_unused]]

* Add more test cases. use the symboldatabase rather than reparsing. Fix travis error.

* test review actions

* change var to usage._var
2020-04-12 20:35:54 +02:00
Daniel Marjamäki 0725c2290c Tokenizer: Do not simplify function pointers to normal pointers as we loose important information 2020-04-10 11:53:32 +02:00
Achouv 7719e4309d
avoid false positive unused static const struct member (#2598) 2020-04-08 18:09:20 +02:00
Rikard Falkeborn b1c6f2946a
Fix redundant FP assignment with unsigned zero (#2521)
* Refactor isNullOperand out of FwdAnalysis

* Improve isNullOperand

* Fix redundantAssignment FP with unsigned zero

* isNullValue check number

* Enhance isNullOperand to handle c++ casts

Also handle cast of NULL.
2020-02-09 11:16:08 +01:00
Daniel Marjamäki b6833b525f Clang import 2020-01-25 17:01:17 +01:00
Daniel Marjamäki bd83630f2e Fixed #8990 (False positive: struct member not used (union)) 2019-12-20 18:31:55 +01:00
Daniel Marjamäki 1d441f64c1 CheckUnusedVar: Quick heuristic so we don't bailout for 'auto' variables 2019-11-17 15:44:57 +01:00
Daniel Marjamäki d0daf1f90d CheckUnusedVar: Assume that assignment has 'standard behavior' by default 2019-11-17 12:33:26 +01:00
Daniel Marjamäki f5e3dc9a38 Improved fix for #8978 (False positive: Variable assigned value that is never used when assigning via iterator) 2019-11-17 12:08:21 +01:00
Daniel Marjamäki 5654630099 Fixed #8978 (False positive: Variable assigned value that is never used when assigning via iterator) 2019-11-16 19:49:54 +01:00
Daniel Marjamäki 06ea1a2b53 Fixed #9312 (FP : variable is assigned a value that is never used (static)) 2019-11-04 17:59:16 +01:00
Daniel Marjamäki 510748134f Fixed #9234 (FP unreadVariable - assignment via iterator) 2019-08-04 10:21:16 +02:00
amai2012 f02636e995 Refactoring: Convert enums to enum classes 2019-08-02 21:14:29 +02:00
Daniel Marjamäki f63011c219 Try to fix daca@home crashes 2019-07-29 19:06:41 +02:00
Daniel Marjamäki a1214348c0 Fixed #8974 (false negative regression about never used variable) 2019-07-29 08:49:19 +02:00
Daniel Marjamäki d2284ddbcd Fix false positives in self check: Variable t is assigned a value that is never used. Classes with destructors was not handled properly. 2019-07-14 16:20:45 +02:00
Daniel Marjamäki 534659e596 Avoid 'unsigned' in Tokenizer. Use 'nonneg' instead for arguments and members. 2019-07-14 15:48:20 +02:00
Daniel Marjamäki 1cadd9398a Fixed #8933 (false negative: (style) Variable is assigned a value that is never used (std::string)) 2019-07-14 09:44:30 +02:00
Daniel Marjamäki 9d5f672dbc Unused struct member: Fix FPs seen in daca@home results for template structs 2019-03-06 20:51:48 +01:00