PVS-StudioWarnings

PVS-Studio warning V596 for FlightGear

Nov 20th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. class sg_throwable : public std::exception { .... };
  2. class sg_exception : public sg_throwable { .... };
  3.  
  4. void Root::scheduleToUpdate(Install* aInstall)
  5. {
  6.   if (!aInstall) {
  7.     sg_exception("missing argument to scheduleToUpdate");
  8.   }
  9.   ....
  10. }
  11.  
  12. This suspicious code was found in FlightGear 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 sg_exception(FOO); root.cxx 239
  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