Advertisement
PVS-StudioWarnings

PVS-Studio warning V612 for Firebird

Nov 24th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. SLONG LockManager::queryData(....)
  2. {
  3.   ....
  4.   for (const srq* lock_srq =
  5.          (SRQ) SRQ_ABS_PTR(data_header.srq_backward);
  6.      lock_srq != &data_header;
  7.      lock_srq = (SRQ) SRQ_ABS_PTR(lock_srq->srq_backward))
  8.   {
  9.     const lbl* const lock = ....;
  10.     CHECK(lock->lbl_series == series);
  11.     data = lock->lbl_data;
  12.     break;
  13.   }
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in Firebird project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V612 An unconditional 'break' within a loop. lock.cpp 965
  20.  
  21. 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