PVS-StudioWarnings

PVS-Studio warning V603 for google-breakpad

Nov 26th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. struct Expr {
  2.   Expr(const UniqueString* ident, long offset, bool deref)
  3.   {
  4.     if (ident == ustr__empty()) {
  5.       Expr();                            <<<<====
  6.     } else {
  7.       postfix_ = "";
  8.       ident_ = ident;
  9.       offset_ = offset;
  10.       how_ = deref ? kExprSimpleMem : kExprSimple;
  11.     }
  12.   }
  13.  
  14.   Expr(string postfix) {
  15.     if (postfix.empty()) {
  16.       Expr();                            <<<<====
  17.     } else {
  18.       postfix_ = postfix;
  19.       ident_ = NULL;
  20.       offset_ = 0;
  21.       how_ = kExprPostfix;
  22.     }
  23.   }
  24.  
  25.   Expr()
  26.   {
  27.     postfix_ = "";
  28.     ident_ = NULL;
  29.     offset_ = 0;
  30.     how_ = kExprInvalid;
  31.   }
  32.   ....
  33. };
  34.  
  35. This suspicious code was found in google-breakpad project by PVS-Studio static code analyzer.
  36. Warning message is:
  37. V603 The object was created but it is not being used. If you wish to call constructor, 'this->Expr::Expr(....)' should be used. module.h 146
  38.  
  39. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Add Comment
Please, Sign In to add comment