Advertisement
PVS-StudioWarnings

PVS-Studio warning V669 for Micro-Manager

Nov 26th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. int pgFocus::GetOffset(double& offset)
  2. {
  3.   MM_THREAD_GUARD_LOCK(&mutex);
  4.   deviceInfo_.offset = offset;
  5.   MM_THREAD_GUARD_UNLOCK(&mutex);
  6.   return DEVICE_OK;
  7. }
  8.  
  9. Strange code. Most likely this is what should be written here: offset = deviceInfo_.offset;
  10.  
  11. This suspicious code was found in Micro-Manager project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V669 The 'offset' argument is a non-constant reference. The analyzer is unable to determine the position at which this argument is being modified. It is possible that the function contains an error. pgFocus.cpp 356
  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
Advertisement