Commit Graph

4549 Commits

Author SHA1 Message Date
Alexander Mai 59d636742e Fixed #4594 (Analyzing errors about system headers not being found) 2013-03-13 06:48:33 +01:00
Robert Reif ee942c5592 Symbol database: Fixed --debug printing. Ticket: #4650 2013-03-13 06:31:13 +01:00
PKEuS 292e52364c Refactorizations:
- Removed empty implementation of CheckUninitVar::runChecks()
- Avoided unnecessary string copying
2013-03-12 08:11:18 -07:00
PKEuS 796c3e101f Implemented better fix for #4644 2013-03-12 08:05:03 -07:00
PKEuS 2333aa2cc7 Don't use native separators for suppression matching 2013-03-12 07:53:18 -07: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
Alexander Mai 9d88cc63e8 Fixed #4642 (False positive: Returning an address value in a function with integer return type is not portable. (not returning address)) 2013-03-12 06:49:13 +01:00
Ettl Martin 3d1cdd0eec #4645 implemented correct range according manpage of usleep(). 2013-03-11 17:38:03 +01:00
Ettl Martin bb115573f7 #4645 implemented new check: (POSIX) argument of function usleep() too big. 2013-03-11 17:04:30 +01:00
PKEuS b3a9ac5c3b Fixed #4644: Don't assign varid to template parameter when 'typename' is used 2013-03-10 06:11:25 -07:00
Daniel Marjamäki 1f40af2ae2 Fixed #4637 (false positive: (error) Uninitialized member variable (missing function inlining)) 2013-03-09 17:55:49 +01: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 3a35944c9e Changes in token.h/cpp:
- Properly set Token::_type to eVariable, eFunction or eName, depending on _function, _variable or _varId being set.
- Token can't be a variable and a function at a time - put Token::_function and Token::_variable into a union.
2013-03-05 08:50:01 -08:00
PKEuS 99a73fe1d3 Don't assign a varid to a variadic function 2013-03-05 08:32:52 -08:00
PKEuS a94598e447 Fixed some gcc and cppcheck messages 2013-03-05 07:07:59 -08:00
PKEuS ca96aaa53b Avoided unnecessary usage of symbolDatabase->isClassOrStruct() 2013-03-05 06:55:31 -08:00
PKEuS 5bdb74ca40 Refactorized CheckOther::checkRedundantCopy():
- Iterate over variable list instead of token list
- Don't stop whole checking after bailing out (continue; instead of break;)
- Support types with qualified names
2013-03-05 06:53:09 -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 0f03995995 Added support for different containers, while-loops and if to CheckStl::stlOutOfBounds() 2013-03-04 10:59:46 -08:00
Daniel Marjamäki b3a2b69120 fixed gcc warning 2013-03-04 19:28:27 +01:00
Daniel Marjamäki 78a3a58a5a Fixed #4628 (False positive: Variable is assigned a value that is never used) 2013-03-04 19:13:49 +01:00
Ettl Martin cc6d138209 fixed gcc warning about missing braces 2013-03-04 14:30:01 +01:00
Ettl Martin 687c3a4654 Merge branch 'master' of github.com:danmar/cppcheck 2013-03-04 14:25:51 +01:00
Ettl Martin c9b519bcd1 improved check: checkCastIntToCharAndBack. The check now handles (cin.get() != EOF) patterns. 2013-03-04 14:25:35 +01:00
PKEuS 34b1d75a10 Fixed handling of std::vector::insert() in CheckStl::pushback() 2013-03-04 02:57:09 -08:00
PKEuS c24527dbde Improved handling of dereferences in CheckClass::noMemset(), fixing false negatives and false positives related to multidimensional arrays and arrays of pointers. 2013-03-04 02:47:29 -08:00
PKEuS dc65667cec Fixed message about unused variable introduced in last commit 2013-03-03 10:46:01 -08:00
PKEuS 8a18f9ec3b Rewrote CheckOther::checkVariableScope() 2013-03-03 10:35:33 -08:00
PKEuS 5c1a05dcbe Refactorizations in CheckOther:
- Make CheckOther::checkCastIntToCharAndBack() work for multiple variables at once
- Improved messages of CheckOther::checkSuspiciousSemicolon() and CheckOther::checkPipeParameterSize()
2013-03-03 09:54:44 -08:00
PKEuS d78c06dc3f Replaced _settings->isEnabled("style") by _settings->isEnabled("warning") wherever warnings are issued 2013-03-03 02:41:59 -08:00
PKEuS d49f4a611a Reduced code duplication in tokenizer 2013-03-02 09:19:53 -08:00
Daniel Marjamki c4419ea920 AST: create possible NULL pointer dereference if tokenlist is empty. Ticket: #4630 2013-03-02 15:49:48 +01:00
Daniel Marjamki b9aba17b23 astyle formatting 2013-03-02 15:48:22 +01:00
Alexander Mai 0dca6e51a0 Fixed #4622 (Patch: Improve formatting for custom templates) 2013-03-02 15:16:18 +01:00
Daniel Marjamäki 9d195144ea CheckClass: Fixed GCC warning 2013-03-02 07:30:55 +01:00
Robert Reif ec7843e911 Fixed #4629 (False positive: warning (uninitMemberVar) - regression) 2013-03-02 07:24:51 +01:00
Daniel Marjamäki d7a52eaecd Fixed #4608 (false positive: (style) struct or union member is never used.) 2013-03-01 16:13:04 +01:00
PKEuS 096aae4439 New check: Warn about using malloc() for classes containing virtual methods, std::-objects or constructors 2013-03-01 06:07:20 -08:00
PKEuS bf9aa102f2 Fixed possible nullptr dereference warning 2013-03-01 03:53:47 -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
PKEuS 0a7fafa319 Fixed mistake in documentation 2013-03-01 02:47:50 -08:00
PKEuS f899e6ca30 Changed behaviour of %op% pattern accordingly to changes to Token::isOp(). Added %cop% as replacement for old %op% 2013-03-01 02:43:59 -08:00
PKEuS 7283152d58 Fixed MSVC warning - removed unused variable/function declaration. 2013-02-28 12:51:48 -08:00
PKEuS 670c4de8a9 Changed behaviour of Token::is*Op() functions:
- Rename Token::isOp() to Token::isConstOp() (indicating that the operator does _not_ modify the input variables)
- Create new Token::isOp(), returning true also for ++, -- and assignment operators
- Make Token::isExtendedOp() returning also true for all assignment and ++/-- operators
2013-02-28 12:50:29 -08:00
Daniel Marjamäki ecafe7a129 Fixed #4624 (Wrong error for instances of std::unique_lock (variable is never used)) 2013-02-28 17:02:58 +01:00
zblair ed03e2c845 Fixed #4539 (False positive: Possible null pointer dereference) 2013-02-27 23:45:21 -08:00
Daniel Marjamäki 94da3bd57f Fixed #4617 (False positive (style): noexcept for constructors) 2013-02-28 06:38:57 +01:00