PVS-StudioWarnings

PVS-Studio warning V1302 for OpenMS

Nov 20th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. TraceFitter<PeakType>* chooseTraceFitter_(double& tau)
  2. {
  3.   // choose fitter
  4.   if (param_.getValue("feature:rt_shape") == "asymmetric")
  5.   {
  6.     LOG_DEBUG << "use asymmetric rt peak shape" << std::endl;
  7.     tau = -1.0;
  8.     return new EGHTraceFitter<PeakType>();
  9.   }
  10.   ....
  11. }
  12.  
  13. virtual void run()
  14. {
  15.   ....
  16.   #pragma omp parallel for
  17.   for (SignedSize i = 0; i < (SignedSize)seeds.size(); ++i)
  18.   {
  19.     ....
  20.     TraceFitter<PeakType>* fitter = chooseTraceFitter_(egh_tau);
  21.     ....
  22.   }
  23.   ....
  24. }
  25.  
  26. This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
  27. Warning message is:
  28. V1302 The 'new' operator cannot be used outside of a try..catch block in a parallel section. featurefinderalgorithmpicked.h 1926
  29.  
  30. 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