PVS-StudioWarnings

PVS-Studio warning V649 for Miranda IM

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 CLUIFramesGetalClientFrame(void)
  2. {
  3.   int i;
  4.  
  5.   if(alclientFrame!=-1)
  6.     return alclientFrame;
  7.  
  8.   if(alclientFrame!=-1)
  9.   {
  10.     /* this value could become invalid if RemoveItemFromList
  11.      * was called, so we double-check */
  12.     ....
  13.   }
  14. }
  15.  
  16. This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. 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: 693, 696. cluiframes.c 696
  19.  
  20. 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