PVS-StudioWarnings

PVS-Studio warning V501 for QT

Nov 19th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. QNativeImage *QFontEngineWin::drawGDIGlyph(....)
  2. {
  3.   ...
  4.   int iw = gm.width.toInt();
  5.   int ih = gm.height.toInt();
  6.  
  7.   if (iw <= 0 || iw <= 0)
  8.     return 0;
  9.   ...
  10. }
  11.  
  12. This is what should have been written here: if (iw <= 0 || ih <= 0)
  13.  
  14. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V501 There are identical sub-expressions to the left and to the right of the '||' operator: iw <= 0 || iw <= 0 QtGui qfontengine_win.cpp 1103
  17.  
  18. 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