PVS-StudioWarnings

PVS-Studio warning V547 for Chromium

Nov 18th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. IdleState CalculateIdleState(unsigned int idle_threshold) {
  2.   ...
  3.   DWORD current_idle_time = 0;
  4.   ...
  5.   // Will go -ve if we have been idle for
  6.   // a long time (2gb seconds).
  7.   if (current_idle_time < 0)
  8.     current_idle_time = INT_MAX;
  9.   ...
  10. }
  11.  
  12. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V547 Expression 'current_idle_time < 0' is always false. Unsigned type value is never < 0.  browser  idle_win.cc  23
  15.  
  16. 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