Commit Graph

275 Commits

Author SHA1 Message Date
Robert Reif 52df31b501 Fixed #5153 ((debug) Scope::checkVariable found variable ')') 2013-11-08 12:56:32 +01:00
Simon Martin 463ef2e71e Ticket #5120: New test case, that works now that #5125 is fixed 2013-10-30 10:15:03 +01:00
Simon Martin 052be76635 Ticket #5125: Avoid infinite recursion for recursive class definitions 2013-10-29 21:41:47 +01:00
Daniel Marjamäki 4a02ca8202 SymbolDatabase: handle method with unknown macro 'void f() MACRO {..}' 2013-09-28 11:44:26 +02:00
Daniel Marjamäki 4b1254bc8d Merge pull request #168 from simartin/ticket_4994
Ticket #4994: Don't crash when checking variable scope for invalid input
2013-09-08 06:57:42 -07:00
Simon Martin 843833f907 Ticket #4994: Don't crash when checking variable scope for invalid input. 2013-09-07 21:16:25 +02:00
PKEuS 6b47ed414a Fixed Function::retDef initialization:
- Move/Copy Constructors and Destructors do not have a return type neither
- Fixed crash in SymbolDatabase::printOut
- Added testing
2013-09-03 10:48:01 +02:00
Robert Reif 8790f6d73f Fixed #4999 (Crash with simple code snipped in rev ab30fa3) 2013-08-31 18:58:55 +02:00
Robert Reif fc435ae9aa CheckIO: fix false negative for a function in a base class not being found, fix false positives and negatives for std::vector operator [] 2013-08-30 05:41:59 +02:00
Robert Reif a1b9bb0688 CheckIO: Fix false positives for functions returning unknown types and false negatives for functions returning record types 2013-08-26 06:03:26 +02:00
Robert Reif 26de3646e9 CheckIo: Revised patch that fixes bug in class function return type. Ticket: #4964 2013-08-24 22:34:52 +02:00
Robert Reif 01fd156852 CheckIO: Start to add checking of function return types. Ticket: #4964 2013-08-24 07:25:50 +02:00
Alexander Mai 986ec42d79 Fixed #4937 (false positive: Assert calls a function which may have desired side effects) 2013-08-22 06:38:54 +02:00
Daniel Marjamäki b61c4b24b4 Fixed syntax error 2013-08-21 16:32:10 +02:00
Stefan Beller e0d71de23a symboldatabase: Remove unneeded check
scope1 cannot be null at that point of time. If it were, the program
would have crashed, before (it's dereferenced ->)
This commit doesn't just remove dead code, but eliminates a tricky bug,
possibly introduced by over-optimizing compilers:
An explanation why the compiler could produce bad code here is found at
http://blog.regehr.org/archives/970

This commit was enabled by http://css.csail.mit.edu/stack/

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
2013-08-20 14:06:20 +02:00
Robert Reif bf8a786265 reduce: add more settings from cppcheck cli 2013-08-19 06:06:53 +02:00
Robert Reif 914893013e Symbol Database: improved type handling. Ticket: #4952 2013-08-17 18:43:15 +02:00
Robert Reif b777388fb8 Symbol database: improved type handling (fix problems in previous commit). Ticket: #4952 2013-08-16 05:42:12 +02:00
Robert Reif f420de24ef SymbolDatabase: Optimisation of previous fix for #4952 2013-08-13 06:36:54 +02:00
Robert Reif cd3044c808 Fixed #4952 (SymbolDatabase: unknown types in log file) 2013-08-12 06:21:03 +02:00
PKEuS a9a5dc0354 Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
Robert Reif e6ab8f478b Symbol database: improved handling of array members 2013-07-20 17:51:13 +02:00
Daniel Marjamäki 9c67af058a SymbolDatabase: Renamed Variable::varId() to Variable::declarationId() to make it more clear how it works. 2013-07-20 12:31:04 +02:00
Daniel Marjamäki 4106972fdc Merge pull request #148 from JustRamires/master
Fixed segmentation fault in SymbolDatabase::SymbolDatabase(Ticket #4892)
2013-07-09 02:55:46 -07:00
Roman Zaytsev Borisovich 295869a866 Fixed segmentation fault in SymbolDatabase::SymbolDatabase(Ticket #4892) 2013-07-09 13:10:03 +04:00
Lucas Manuel Rodriguez d177c8fd03 Fixed #4824 (False positive: (warning) Member variable 'Foo::m_state' is not initialized in the constructor.) 2013-07-08 06:38:33 +02:00
Zachary Blair a381170886 Fixed #4874 (Minor spelling corrections) 2013-06-26 00:47:02 -07:00
Alexander Mai 0be1892b92 Fixed #4806 (Crash in Type::initBaseInfo() in clang testcode) 2013-06-16 21:46:01 +02:00
Roman Zaytsev Borisovich 4610b135dc Fixed #4694 2013-06-07 10:37:33 +04:00
Robert Reif 2c8360c607 Fixed #4789 (uninitMemberVar not found when constructor contains default parameters) 2013-05-18 18:33:24 +02:00
PKEuS cf5d8fa3df Use Token::link() instead of Token::findClosingBracket() whereever possible 2013-04-15 13:48:28 -07:00
Frank Zingsheim 54e7c8f6a2 Implemented support for move constructors:
Adapt code to Function::eMoveConstructor
introduced in commit eb2962792f
2013-04-10 21:57:22 +02:00
PKEuS eb2962792f Implemented support for move constructors:
- Changed behaviour of Token::function - is now also set for declarations
- Resolved TODO in testclass.cpp
- removed redundant code in Scope::findFunction - it is safe to call nextArgument() on functions without arguments
- Use Token::function in checkother.cpp
2013-04-04 10:53:55 -07:00
PKEuS 188096665c Implemented support for rvalue references (C++11):
- Split up && when it is part of an rvalue reference declaration
- Added support into symbol database
- Current implementation sets Variable::isReference() to true also for rvalue references - they can probably be treated like normal references in many checks.

Changed behaviour of symbol database: Insert argument Variable of functions that are not implemented into SymbolDatabase::_variableList
2013-04-04 09:47:44 -07:00
Robert Reif a3f9b5c07d Fixed #4686 (Prefer prefix ++/-- operators for non-primitive types with template iterator) 2013-03-30 13:49:56 +01:00
Robert Reif 3f57b5a6ca Fixed #4682 (using 'struct' disables checking) 2013-03-28 06:36:49 +01:00
Daniel Marjamäki c0a34649c4 fixed 'duplicate expression' false positives for float-float. Ticket: #4639 2013-03-14 19:11:29 +01:00
PKEuS 641ac5c02a Fixed #4352: Ensure that class provides an iterator interface. 2013-03-14 09:00:22 -07:00
Robert Reif 4b9b87e310 Fixed #4646 (false positive: (style, inconclusive) Technically the member function 'C<T>::operator+=' can be const.) 2013-03-14 06:34:12 +01:00
Robert Reif ee942c5592 Symbol database: Fixed --debug printing. Ticket: #4650 2013-03-13 06:31:13 +01:00
PKEuS 14feaa8d39 Refactorizations:
- Fixed lots of cppcheck messages about functions that can be const or static
- Fixed possible nullpointer dereference message in symboldatabase.cpp
- Replaced tokAt(+-1) by next()/previous()
2013-03-12 07:42:00 -07:00
Robert Reif 25c36b56fa CheckClass: made warnings about uninitialized members in default constructors inconclusive. Ticket: #4639 2013-03-09 09:20:48 +01:00
PKEuS 1fbef0e4e6 Reduced code duplication in symboldatabase 2013-03-05 10:53:24 -08:00
PKEuS 9287e40e99 Incresed constness of several pointers in symboldatabase 2013-03-05 09:42:42 -08:00
PKEuS a94598e447 Fixed some gcc and cppcheck messages 2013-03-05 07:07:59 -08:00
PKEuS 7bc729bc63 - Moved more functionality from Scope to Type: BaseInfo and FriendInfo
- Replaced Scope->findQualifiedScope by SymbolDatabase::findScope
- Improved SymbolDatabase::findType
2013-03-05 06:28:40 -08:00
PKEuS 66a3555897 Implement initial support for Types in Symboldatabase:
- For each class/struct/union, a Type instance is added to SymbolDatabase::typeList.
- A scope is no longer created for declared but not defined types

Fixed name detection for classes when they are declared like this: "class ::Foo::Sub {..."
2013-03-05 04:33:38 -08:00
PKEuS 0105f8223c Simplified several Token::Match/simpleMatch calls when match string consists of a single pattern
Fixed two CheckInternal error messages
2013-03-01 03:42:04 -08:00
Robert Reif 509061afff Fixed #4620 (False positive: Uninitialized variable in constructor (1.58)) 2013-02-27 06:59:04 +01:00
Robert Reif 21bf5173e5 Symbol database: faster implementation. Ticket: #4494 2013-02-20 07:46:06 +01:00