PVS-StudioWarnings

PVS-Studio warning V1301 for OpenMS

Nov 26th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. Size getTheoreticalmaxPosition() const
  2. {
  3.   if (!this->size())
  4.   {
  5.     throw Exception::Precondition(__FILE__, __LINE__, ....);
  6.   }
  7.   ....
  8. }
  9.  
  10. virtual void run()
  11. {
  12.   ....
  13.   #pragma omp parallel for
  14.   for (SignedSize i = 0; i < (SignedSize)seeds.size(); ++i)
  15.   {
  16.     ....
  17.     f.setMZ(
  18.        traces[traces.getTheoreticalmaxPosition()].getAvgMZ());
  19.     ....
  20.   }
  21.   ....
  22. }
  23.  
  24. This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V1301 The 'throw' keyword cannot be used outside of a try..catch block in a parallel section. featurefinderalgorithmpickedhelperstructs.h 199
  27.  
  28. 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