PVS-StudioWarnings

PVS-Studio warning V612 for Prime95

Nov 10th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. void registerThreadTermination (void)
  2. {
  3.   ....
  4.   for (i = 0; i < NUM_THREAD_HANDLES; i++) {
  5.     if (THREAD_HANDLES[i] != h) break;
  6.     THREAD_HANDLES[i] = THREAD_HANDLES[--NUM_THREAD_HANDLES];
  7.     break;
  8.   }
  9. }
  10.  
  11. This suspicious code was found in Prime95 project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V612 An unconditional 'break' within a loop. prime95 comm95b.c 133
  14.  
  15. 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