Advertisement
PVS-StudioWarnings

PVS-Studio warning V517 for QT

Nov 21st, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
  2. {
  3.   ...
  4.   else if (e == QKeySequence::MoveToNextLine) {
  5.     op = QTextCursor::Down;
  6.   }
  7.   else if (e == QKeySequence::MoveToPreviousLine) {  <<<---
  8.     op = QTextCursor::Up;
  9.   }
  10.   else if (e == QKeySequence::MoveToPreviousLine) {  <<<---
  11.     op = QTextCursor::Up;
  12.   }
  13.   else if (e == QKeySequence::MoveToStartOfLine) {
  14.     op = QTextCursor::StartOfLine;
  15.   ...
  16. }
  17.  
  18. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 230, 233. QtGui qtextcontrol.cpp 230
  21.  
  22. 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