PVS-StudioWarnings

PVS-Studio warning V547 for Ultimate ToolBox

Nov 18th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void COXAutoListBox::DrawItem(....)
  2. {
  3.   ...
  4.   if (lpDrawItemStruct->itemID>=0)
  5.   {
  6.     ...
  7.   }
  8.   ...
  9. }
  10.  
  11. Most likely this is what should be written here: (lpDrawItemStruct->itemID != (UINT)(-1))
  12.  
  13. This suspicious code was found in Ultimate ToolBox project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V547 Expression 'lpDrawItemStruct -> itemID >= 0' is always true. Unsigned type value is always >= 0. UT oxautolistbox.cpp 56
  16.  
  17. 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