Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for Firebird

Nov 10th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. static processing_state add_row(TEXT* tabname)
  2. {
  3.   ....
  4.   unsigned i = n_cols;
  5.   while (--i >= 0)
  6.   {
  7.     if (colnumber[i] == ~0u)
  8.   {
  9.        bldr->remove(fbStatus, i);
  10.        if (ISQL_errmsg(fbStatus))
  11.          return (SKIP);
  12.     }
  13.   }
  14.   msg.assignRefNoIncr(bldr->getMetadata(fbStatus));
  15.   ....
  16. }
  17.  
  18. This suspicious code was found in Firebird project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V547 Expression '-- i >= 0' is always true. Unsigned type value is always >= 0. isql.cpp 3421
  21.  
  22. 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