Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for QT

Nov 27th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.51 KB | None | 0 0
  1. bool operator==(const InheritedFlags& other) const
  2. {
  3.   ...
  4.   return
  5.     (_empty_cells == other._empty_cells) &&
  6.     (_caption_side == other._caption_side) &&
  7.     (_list_style_type == other._list_style_type) &&
  8.     (_list_style_position == other._list_style_position) &&
  9.     (_visibility == other._visibility) &&
  10.     (_text_align == other._text_align) &&
  11.     (_text_transform == other._text_transform) &&       <<<---
  12.     (_text_decorations == other._text_decorations) &&
  13.     (_text_transform == other._text_transform) &&       <<<---
  14.     (_cursor_style == other._cursor_style) &&
  15.     (_direction == other._direction) &&
  16.     (_border_collapse == other._border_collapse) &&
  17.     (_white_space == other._white_space) &&
  18.     (_box_direction == other._box_direction) &&
  19.     (_visuallyOrdered == other._visuallyOrdered) &&
  20.     (_htmlHacks == other._htmlHacks) &&
  21.     (_force_backgrounds_to_white ==
  22.      other._force_backgrounds_to_white) &&
  23.     (_pointerEvents == other._pointerEvents);
  24.   ...
  25. }
  26.  
  27. There's no error. It's just an unnecessary line. It is still useful to find and fix such code fragments: your code will become a bit shorter.
  28.  
  29. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  30. Warning message is:
  31. V501 There are identical sub-expressions to the left and to the right of the '&&' operator. QtWebKit renderstyle.h 162
  32.  
  33. 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
Advertisement