Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for ReactOS

Nov 27th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. static INT FASTCALL
  2. MenuButtonUp(MTRACKER *Mt, HMENU PtMenu, UINT Flags)
  3. {
  4.   UINT Id;
  5.   ....
  6.   Id = NtUserMenuItemFromPoint(....);
  7.   ....
  8.   if (0 <= Id &&
  9.       MenuGetRosMenuItemInfo(MenuInfo.Self, Id, &ItemInfo) &&
  10.       MenuInfo.FocusedItem == Id)
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression '0 <= Id' is always true. Unsigned type value is always >= 0. menu.c 2663
  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
Advertisement