PVS-StudioWarnings

PVS-Studio warning V637 for KDE4

Nov 20th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. void
  2. KViewSearchLine::slotColumnsRemoved(const QModelIndex &,
  3.                                     int first, int last)
  4. {
  5.   if(d->treeView)
  6.     updateSearch();
  7.   else
  8.   {
  9.     if(d->listView->modelColumn() >= first &&
  10.        d->listView->modelColumn() <= last)
  11.     {
  12.       if(d->listView->modelColumn()>last)   //<==
  13.         kFatal()<<"...."<<endl;
  14.       updateSearch();
  15.     }
  16.   }
  17. }
  18.  
  19. This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 410, 412. kebsearchline.cpp 410
  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