PVS-StudioWarnings

PVS-Studio warning V656 for QT

Nov 18th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. AtomicComparator::ComparisonResult
  2. IntegerComparator::compare(const Item &o1,
  3.                            const AtomicComparator::Operator,
  4.                            const Item &o2) const
  5. {
  6.   const Numeric *const num1 = o1.as<Numeric>();
  7.   const Numeric *const num2 = o1.as<Numeric>();
  8.  
  9.   if(num1->isSigned() || num2->isSigned())
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V656 Variables 'num1', 'num2' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'o1.as < Numeric > ()' expression. Check lines: 220, 221. qatomiccomparators.cpp 221
  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