Advertisement
PVS-StudioWarnings

PVS-Studio warning V564 for KDE4

Nov 27th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. DataAccess::DataAccessFlags typeToDataAccessFlags(....)
  2. {
  3.   DataAccess::DataAccessFlags ret = DataAccess::Read;
  4.   TypePtr< ReferenceType > reftype=type.cast<ReferenceType>();
  5.   if(reftype && reftype->baseType() &&
  6.      !reftype->baseType()->modifiers() &    //<==
  7.      AbstractType::ConstModifier)
  8.     ret |= DataAccess::Write;
  9.  
  10.   return ret;
  11. }
  12.  
  13. This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V564 The '&' operator is applied to bool type value. You've probably forgotten to include parentheses or intended to use the '&&' operator. usedecoratorvisitor.cpp 40
  16.  
  17. 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/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement