Advertisement
PVS-StudioWarnings

PVS-Studio warning V517 for Micro-Manager

Nov 27th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. const char* g_Out = "Out";
  2.  
  3. int FieldDiaphragm::OnCondensor(....)
  4. {
  5.   ....
  6.   std::string value;
  7.   ....
  8.   if (value == g_Out)
  9.     return
  10.       g_hub.SetCondensorPosition(*this, *GetCoreCallback(), 0);
  11.   else if (value == g_Out)
  12.     return
  13.       g_hub.SetCondensorPosition(*this, *GetCoreCallback(), 1);
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in Micro-Manager project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 1455, 1457. LeicaDMR.cpp 1455
  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