PVS-StudioWarnings

PVS-Studio warning V519 for QT

Nov 20th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. int QCleanlooksStyle::pixelMetric(....)
  2. {
  3.   ... //cases
  4.  
  5.   case PM_SpinBoxFrameWidth:
  6.     ret = 3;
  7.     break;
  8.   case PM_MenuBarItemSpacing:
  9.     ret = 6;
  10.   case PM_MenuBarHMargin:
  11.     ret = 0;
  12.     break;
  13.  
  14.   ... //cases
  15. }
  16.  
  17. The break operator is missing.
  18.  
  19. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V519 The 'ret' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 3765, 3767. QtGui qcleanlooksstyle.cpp 3767
  22.  
  23. 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