PVS-StudioWarnings

PVS-Studio warning V564 for wesnoth

Nov 19th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. enum { REMOVE_EMPTY = 0x01,
  2.        STRIP_SPACES  = 0x02
  3. };
  4.  
  5. void unit_preview_pane::draw_contents()
  6. {
  7.   ...
  8.   // we don't remove empty lines, so all fields stay
  9.   // at the same place
  10.   const std::vector<std::string> lines =
  11.     utils::split(text.str(), '\n',
  12.       utils::STRIP_SPACES & !utils::REMOVE_EMPTY);
  13.   ...
  14. }
  15.  
  16. This suspicious code was found in wesnoth project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V564 The '&' operator is applied to bool type value. You've probably forgotten to include parentheses or intended to use the '&&' operator. wesnoth dialogs.cpp 902
  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