PVS-StudioWarnings

PVS-Studio warning V547 for ICU

Nov 17th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. int32_t getRuleWeekInMonth(void) const;
  2.  
  3. typedef struct _SYSTEMTIME {
  4.   ....
  5.   WORD wDay;
  6.   ....
  7. } SYSTEMTIME, *PSYSTEMTIME;
  8.  
  9. static UBool getSystemTimeInformation(....)
  10. {
  11.   ....
  12.   standardDate.wDay = std->getRule()->getRuleWeekInMonth();
  13.   if (standardDate.wDay < 0) {
  14.     standardDate.wDay = 5;
  15.   }
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in ICU project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V547 Expression 'standardDate.wDay < 0' is always false. Unsigned type value is never < 0. wintzimpl.cpp 66
  22.  
  23. 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