PVS-StudioWarnings

PVS-Studio warning V649 for Micro-Manager

Nov 21st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. int AFC::Initialize()
  2. {
  3.   int ret = DEVICE_OK;
  4.   ....
  5.   if (ret != DEVICE_OK)
  6.     return ret;
  7.   AddAllowedValue("DichroicMirrorIn", "0", 0);
  8.   AddAllowedValue("DichroicMirrorIn", "1", 1);
  9.   if (ret != DEVICE_OK)
  10.     return ret;
  11.   ....
  12. }
  13.  
  14. Not terrible, but second if() does not make sense.
  15.  
  16.  
  17. This suspicious code was found in Micro-Manager project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V649 There are two 'if' statements with identical conditional expressions. The first 'if' statement contains function return. This means that the second 'if' statement is senseless. Check lines: 2918, 2922. LeicaDMI.cpp 2922
  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