PVS-StudioWarnings

PVS-Studio warning V596 for MTASA

Nov 20th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. bool String::grow(size_type new_size)
  2. {
  3.   // check for too big
  4.   if (max_size() <= new_size)
  5.     std::length_error(
  6.       "Resulting CEGUI::String would be too big");
  7.   ....
  8. }
  9.  
  10. Most likely this is what should be written here: throw std::length_error("Resulting CEGUI::String would be too big");
  11.  
  12. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V596 The object was created but it is not being used. The 'throw' keyword could be missing: throw length_error(FOO); ceguistring.cpp 59
  15.  
  16. 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