PVS-StudioWarnings

PVS-Studio warning V637 for TinyCAD

Nov 19th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. void CTinyCadView::OnDraw(CDC* pDC)
  2. {
  3.   ....
  4.   // Is any of this region in the off-page area?
  5.   if (!pDC->IsPrinting())
  6.   {
  7.     // Paint the region white
  8.     if (pDC->IsPrinting())
  9.     {
  10.       dc.SelectBrush(cWHITE);
  11.       dc.SelectPen(PS_SOLID, 1, cWHITE);
  12.     }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in TinyCAD project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V637 Two opposite conditions were encountered. The second condition is always false. Check lines: 86, 90. paint.cpp 86
  19.  
  20. 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