PVS-StudioWarnings

PVS-Studio warning V519 for OpenDDS

Nov 13th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. int
  2. InfoRepoMulticastResponder::init(
  3.   CORBA::ORB_ptr orb,
  4.   const char *mcast_addr)
  5. {
  6.   ....
  7.   } else {
  8.     actual_mcast_addr =
  9.       CORBA::string_alloc(static_cast<CORBA::ULong>(
  10.         ACE_OS::strlen(mcast_addr)));
  11.  
  12.     actual_mcast_addr = mcast_addr;
  13.   }
  14.   ....
  15. }
  16.  
  17. This suspicious code was found in OpenDDS project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V519 The 'actual_mcast_addr' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 89, 92. inforepomulticastresponder.cpp 92
  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