PVS-StudioWarnings

PVS-Studio warning V501 for libjingle

Nov 12th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. bool ParseGingleTransportInfos(....)
  2. {
  3.   ...
  4.   bool has_audio =
  5.     FindContentInfoByName(contents, CN_AUDIO) != NULL;
  6.   bool has_video =
  7.     FindContentInfoByName(contents, CN_VIDEO) != NULL;
  8.  
  9.   if (!has_audio && !has_audio) {
  10.     ...
  11. }
  12.  
  13. This is what should have been written here: if (!has_audio && !has_video) {
  14.  
  15. This suspicious code was found in libjingle project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V501 There are identical sub-expressions to the left and to the right of the '&&' operator: !has_audio &&!has_audio libjingle_p2p sessionmessages.cc 308
  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