PVS-StudioWarnings

PVS-Studio warning V600 for ITK

Nov 19th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. void MultiThreader::MultipleMethodExecute()
  2. {
  3.   ....
  4.   HANDLE process_id[ITK_MAX_THREADS];
  5.   ....
  6.   process_id[thread_loop] = (void *) _beginthreadex(0, 0, ....);
  7.  
  8.   if ( process_id == 0 )
  9.   {
  10.     itkExceptionMacro("Error in thread creation !!!");
  11.   }
  12.   ....
  13. }
  14.  
  15. Most likely this is what should be written here: if ( process_id[thread_loop] == 0 )
  16.  
  17. This suspicious code was found in ITK project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V600 Consider inspecting the condition. The 'process_id' pointer is always not equal to NULL. itkmultithreaderwinthreads.cxx 90
  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