Commit Graph

144 Commits

Author SHA1 Message Date
PKEuS 6906001366 Added support for references to symboldatabase 2012-01-26 17:04:25 +01:00
Robert Reif 6b0aff487f symbol database: add preliminary support for throw/catch block scopes. Just like the rest of cppcheck, ... is not handled properly for variables. Deep namespaces are also not handled properly yet. This is not an issue because this new capability is not used by any checks so it should be harmless. 2012-01-25 22:05:29 -05:00
Robert Reif b6afa8a025 symbol database: add missing variable flag debug printing 2012-01-24 20:45:38 -05:00
Robert Reif e39b70c1be symbol database: add missing endl in debug dump 2012-01-22 22:32:53 -05:00
Daniel Marjamäki f81557da50 Fixed #3508 (Symbol database: mixing up constructors and destructors) 2012-01-22 19:48:36 +01:00
PKEuS 96ae010e48 - Correctly set Scope::function variable in symboldatabase
- Refactorizations
- Fixed some cppcheck warnings
2012-01-21 10:08:09 +01:00
Daniel Marjamäki 6a63104743 Fixed #3320 (False positive: Member variable is not initialized in the constructor (namespaces).) 2012-01-07 09:28:26 +01:00
Daniel Marjamäki c5f62c19d6 astyle formatting 2012-01-05 18:24:27 +01:00
Daniel Marjamäki 56a5e08f6b Use symbol database dump code written by Robert Reif. The symbol database is dumped if --debug is used. 2012-01-05 18:22:54 +01:00
Edoardo Prezioso 94a2287370 Revert 'using' changes as it was until some time ago. 2012-01-02 19:27:32 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
Edoardo Prezioso b9c796d9f8 - Re-elaborate 'using' keyword skipping in Tokenizer::setVarId and
Scope::getVariableList;
- Improve setVarId: add possible declaration: 'A f(&x);' and change from:
'if (...){}else{ continue; };' to: 'if (!...) continue;';
- Little refactoring of 'Tokenizer::removeTokens()'.
2011-12-31 21:36:19 +01:00
Reijo Tomperi 0e1fb5f75b astyle fix 2011-12-30 21:01:33 +02:00
Edoardo Prezioso 0d3bf5340d Improve varId and getVariableList filter, related to previous commit. 2011-12-30 18:13:42 +01:00
Edoardo Prezioso 8c68b811f3 Fix debug message "Scope::checkVariable found variable '%var%' with varid 0." in C# code with 'using %var%;'. 2011-12-30 13:01:09 +01:00
Daniel Marjamäki a4dcf8feea Fixed #3435 (False positive: (warning) Member variable 'A::m_Vec' is not initialized in the constructor.) 2011-12-25 11:05:06 +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
Marek Zmysłowski 4b4f201b79 Fixed #3437 (segmentation fault of cppcheck) 2011-12-22 07:28:28 +01:00
PKEuS f306246c7f Improved support for references and pointers in SymbolDatabase
Replaced several isPointer functions by Variable::isPointer function
Refactorizations & Make use of symbolDatabase more often
2011-12-17 19:04:03 +01:00
Edoardo Prezioso 4cad5d4df4 Workaround fixes to shut up some cppcheck '--inconclusive' whinings. 2011-12-13 00:24:34 +01:00
Edoardo Prezioso 42e369a4b4 Change every 'tokAt(..)->link()' to 'linkAt(..)'. 2011-11-20 14:24:27 +01:00
Edoardo Prezioso 2c64d299ca Change every 'tokAt(...)->str()' to 'strAt(...)'. 2011-11-13 13:10:59 +01:00
Edoardo Prezioso b28a44dc3b Change: 'next()->next()'->'tokAt(2)', 'previous()->previous()'->'tokAt(-2)'. 2011-11-12 22:33:03 +01:00
Thomas Jarosch 54adb910ec Use Token::simpleMatch instead of Token::Match for simple patterns 2011-10-27 15:59:22 +02:00
Edoardo Prezioso 12f6ce46f8 Add more warnings and fix the ones reported by them. 2011-10-22 15:05:43 +02:00
Benjamin Goose 3f25bd9530 Qualify fill_n properly.
Relying on ADL isn't a good idea as it's not always well implemented.
2011-10-20 09:02:20 +02:00
Daniel Marjamäki 1ec32e27db Borland: Fixed compiler errors 2011-10-16 07:52:54 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Robert Reif a1a839fadc fix tokenizer and symbol database to not mistake goto statement for variable declaration 2011-10-07 08:11:48 -04:00
Robert Reif 092ba0b1de fix symbol database bug where function variable type of a nested class was not found 2011-09-28 22:05:26 -04:00
Robert Reif 40009d091d add multi-dimension array support to second checkScope and use it for member arrays 2011-09-11 20:42:57 -04:00
Robert Reif 7cb5c97e7d move member variable lookup code from a check to the symbol database so it can be reused by other checks 2011-09-03 12:22:13 -04:00
Robert Reif d749e28dc0 another partial fix for #3063 (false negative: multi dimensional arrays not well supported) 2011-09-02 21:07:29 -04:00
Robert Reif 7775934492 really fix multi-dimensional arrays with undefined size 2011-08-28 13:32:42 -04:00
Robert Reif cf6d04de74 fix #3044 (Symbol database: handle multidim array with unknown dimension 'char a[][4]') 2011-08-28 11:40:55 -04:00
Robert Reif dfe89f395a fix #3049 (False Positive - Technically the member function 'VideoOutputNull::SetupDeinterlace' can be const.) 2011-08-25 19:13:53 -04:00
Robert Reif 6f3131da8c fix a serious symbol database bug where parts of a function could be skipped 2011-08-23 20:12:29 -04:00
Robert Reif 88019658b4 fix #3013 (segmentation fault of cppcheck ( struct x : virtual y )) 2011-08-16 19:16:58 -04:00
Robert Reif f7b9d4d726 fix #2991 (segmentation fault of cppcheck ( ::y(){x} )) 2011-08-11 17:57:54 -04:00
Robert Reif 54141f2e7f fix #2943 (Symbol database: Wrong parsing of std::vector as base class.) 2011-07-27 11:23:22 -04:00
Robert Reif 5e1fd81ea7 add support for local variables with constructors to the symbol database 2011-07-23 15:12:30 -04:00
Robert Reif d447e61b09 fix #2884 (Integer overflow warning in 64-bit build) 2011-07-01 16:59:17 -04:00
Robert Reif c99a15516d fix symbol database derived template class support 2011-06-29 19:52:07 -04:00
Robert Reif 18369ea6ac add global namespace derived class support 2011-06-29 19:43:39 -04:00
Robert Reif 272eb445fb fix #2865 (segmentation fault of cppcheck ( char a[1] )) 2011-06-27 07:31:10 -04:00
Robert Reif 93495613dd replace some pattern matching with variable lookup in checkGlobalAndLocalVariable 2011-06-24 08:02:41 -04:00
Robert Reif 4656eba34c set symbol database array variable dimensions specified by a variable to the maximum size that variable can hold 2011-06-23 22:35:15 -04:00
Robert Reif 0c46f44e3d add array information to symbol database 2011-06-22 22:41:11 -04:00
Robert Reif e8eb20c6ef fix debug warning for function parameters with template with varid of 0 2011-04-28 20:53:31 -04:00
Robert Reif 6750c7b492 don't debug warn about class function definitions without body having missing varid on function parameters 2011-04-22 21:41:55 -04:00