Commit Graph

73 Commits

Author SHA1 Message Date
Daniel Marjamäki 75e20a996d assign function pointer: Fixed false positive when pointer is used also. Ticket: #2930 2013-02-02 15:26:14 +01:00
Daniel Marjamäki 6bb8dd605a assign function parameters: only show warning when --enable=warning or --enable=style is used. Ticket: #2930 2013-02-02 15:08:43 +01:00
Daniel Marjamäki cbbb582fc9 Fixed #2930 (new check: redundant assignment of pointer function parameter) 2013-02-01 19:16:17 +01:00
Robert Reif 94c953931d Simplify checks by caching symbol database Variable pointer in Token 2013-01-31 20:08:48 +01:00
Robert Reif ec1c86c152 Symbol database: more function/variable cleanup. Ticket: #4494 2013-01-31 06:41:18 +01:00
Robert Reif 859793731d SymbolDatabase: Refactor findFunction handling. Ticket: #4494 2013-01-28 06:47:48 +01:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Robert Reif 0d4b87c71e SymbolDatabase: Improved find function functionality. Taking arguments into account 2012-10-14 17:30:37 +02:00
Robert Reif 5a7aae31f3 speed up checkautovariables by caching commonly looked up stuff in the symbol database (#4266) 2012-10-12 06:15:46 +02:00
PKEuS 1e5d082251 Moved remaining part of c_str() checking to checkstl.cpp. Fixed false positive #4157. 2012-09-10 15:20:38 +02:00
PKEuS 4fb464982c Fixed crash reported in #4076 2012-08-22 10:17:23 -07:00
PKEuS e05a597066 Fixed false negatives in checkautovariables.cpp:
- Detect returning temporary instances (#4076)
- Added support for returning user defined types
2012-08-22 04:08:32 -07:00
Daniel Marjamäki 9352e124fe Auto variables: Speedup my fix. Use the symbol database instead of Token::findmatch. 2012-07-19 16:42:56 +02:00
Daniel Marjamäki 17c27f51ff Fixed #3791 (False positive: returnTempReference) 2012-07-18 07:22:29 +02:00
PKEuS 247d820027 Fixed #3972: Don't issue auto variable error when the address is assigned to a reference to a non-pointer. 2012-07-13 05:21:45 -07:00
PKEuS f5f63dc4a6 Message refactorization: check64bit.cpp
Added two articles in checkautovariables.cpp as suggested by kimmov
2012-07-08 02:38:58 -07:00
PKEuS 0f1cb4c98c Message refactorization: checkassignif.cpp, checkautovariables.cpp 2012-07-07 11:31:18 -07:00
Daniel Marjamäki d6e2e867ea refactoring CheckAutoVariables 2012-06-22 11:21:51 +02:00
PKEuS ec00824fd3 Fixed #3357:
- Print "inconclusive" tag in cli
- Fixed inconclusive handling in checkbufferoverrun.cpp
- Merged reportInconclusiveError into reportError by adding an additional parameter "bool inconclusive" which is false per default
2012-05-06 10:37:41 -07:00
PKEuS 746beb98bf Added support for delete and delete[] in invalidDeallocation check (fixes #1773) 2012-04-26 16:44:33 +02:00
Daniel Marjamäki abcbe2e49f Fixed #3594 (false positive: returning reference to auto variable) 2012-03-28 18:21:06 +02:00
PKEuS 1ef99e2f21 Improved checkautovariables:
- Added support for checking a few more code patterns
- Simplified code by using more information from the symboldatabase
- Moved redundant part of c_str-check to checkstl
Two fixes according to output of pvs studio in testsimplifytokens.cpp
2012-03-01 18:38:20 +01:00
PKEuS 91a01a0a0d - checkUnsignedDivision checks for variable/variable (inconclusive). General bailout for if-statements.
- Make use of recently implemented symboldatabase functions (catch-support, reference-support)
- Other refactorizations
2012-01-28 12:32:28 +01:00
PKEuS c273d6d31d Refactorized checkautovariables.cpp. Removed indendation counters.
Fixed #3478
2012-01-08 15:32:22 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
Daniel Marjamäki 6a0c463ebd #3382 (Clarify error message 'invalid deallocation') 2011-12-30 10:32:55 +01:00
Daniel Marjamäki fd3f384e24 astyle formatting 2011-12-26 07:58:02 +01:00
Daniel Marjamäki 096b22c46e #3434 (False positive Returning reference to auto variable) 2011-12-26 07:44:16 +01:00
PKEuS dca03c3ce2 Remove unnecessary includes
Also add a unit test related to #3427
Also improve the description text in checkclass and remove unused variable.
2011-12-23 23:31:48 +02:00
Edoardo Prezioso 767413adad 1)internal check found a 'findmatch' with simple string argument;
2)Style: uniform 'while (...)' when inside it there's an assignment;
3)Replace '0' with 'NULL' where there's comparison with a pointer.
2011-12-01 12:04:47 +01:00
Edoardo Prezioso a32b05197d Change every 'tokAt(1)' to 'next()' and every 'tokAt(-1)' to 'previous()'.
Added a safety check to ensure that a 'previous()' call doesn't crash (not sure if it's needed or not).
2011-11-20 15:59:37 +01:00
Edoardo Prezioso 11dd3c09ce Change every 'tokAt(1)->' to 'next()->' because 'tokAt(1) == 0' is equivalent to 'next() == 0', hence the equivalent cppcheck crash. 2011-11-20 15:09:57 +01:00
Edoardo Prezioso 42e369a4b4 Change every 'tokAt(..)->link()' to 'linkAt(..)'. 2011-11-20 14:24:27 +01:00
Thomas Jarosch 54adb910ec Use Token::simpleMatch instead of Token::Match for simple patterns 2011-10-27 15:59:22 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Robert Reif e19cbf0cdd fix false positive introduced by previous false negative fix commit 2011-09-02 10:39:04 -04:00
Robert Reif 833865e736 fix #3066 (False positive: Inconclusive: Assigning address of local auto-variable to a function parameter.) 2011-09-01 22:22:33 -04:00
Robert Reif 5bad978833 fix line number in messagex for CheckAutoVariables::autoVariables 2011-09-01 20:34:31 -04:00
Robert Reif 2667e34a07 fix again #3064 (false negative: returning address of stack variable) 2011-09-01 18:30:49 -04:00
Robert Reif ff690abf80 better error message for #3064 (false negative: returning address of stack variable) 2011-09-01 07:10:11 -04:00
Robert Reif e7dc765ece fix #3064 (false negative: returning address of stack variable) 2011-08-31 21:36:31 -04:00
Robert Reif 7eb43bc107 partial fix for #3030 (Improve check: Returning pointer to local array variable with '&' pointer operator) 2011-08-20 15:08:30 -04:00
Daniel Marjamäki 9a24492a00 Fixed #2975 (False positive: Return of the address of an auto-variable) 2011-08-10 18:16:31 +02:00
Daniel Marjamäki 2b8b0c44b2 Fixed #2969 (False positive: assign address of auto-var to function parameter, when function parameter is reassigned later) 2011-08-09 18:24:39 +02:00
Daniel Marjamäki 2b48c7624c Auto Variables: Reverted fix for #1514 because my idea was wrong. See ticket: #2944 2011-07-27 10:43:44 +02:00
Robert Reif 527c1aae33 fix #2931 (another false negative in auto variables checking when function parameter is a struct) 2011-07-22 08:31:31 -04:00
Robert Reif 84ca1902a5 fix #1514 (Improve CheckAutoVariables: assign autovariable address to effective parameter) 2011-07-21 22:37:36 -04:00
Robert Reif 4e64d35462 fix #2926 (false negative in auto variables checking when function parameter is a struct) 2011-07-21 22:26:42 -04:00
Robert Reif cc1ecccd01 fix #2928 (False positive (static variable misinterpreted as auto variable)) 2011-07-21 18:20:19 -04:00
Daniel Marjamäki 31e3844f3f Fixed #2856 (--errorlist not printing all auto-variable errors) 2011-07-21 14:50:38 +02:00