Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for DeSmuME

Nov 25th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. static bool _FAT_check_position_for_next_cluster(....,
  2.  size_t remain, ....)
  3. {
  4.   ...
  5.   if ((remain < 0) ||
  6.       (position->sector > partition->sectorsPerCluster)) {
  7.     // invalid arguments - internal error
  8.     r->_errno = EINVAL;
  9.     goto err;
  10.   }
  11.   ...
  12. }
  13.  
  14. This suspicious code was found in DeSmuME project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V547 Expression 'remain < 0' is always false. Unsigned type value is never < 0. DeSmuME_VS2005 fatfile.cpp 527
  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