PVS-StudioWarnings

PVS-Studio warning V559 for amtsdk

Nov 26th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. bool SetCBPolicy(....)
  2. {
  3.   ...
  4.   if(status = true)
  5.   {
  6.     PrintSuccess();
  7.   }
  8.  
  9.   return status;
  10. }
  11.  
  12. This is what should have been written here: if(status == true)
  13.  
  14.  
  15. This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V559 Suspicious assignment inside the condition expression of 'if' operator: status = true. AgentPresenceAPIConsole agentpresenceapiconsole.cpp 530
  18.  
  19. 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