Advertisement
PVS-StudioWarnings

PVS-Studio warning V639 for Eigen

Nov 21st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. template<typename Scalar> EIGEN_DEVICE_FUNC
  2. inline bool isApprox(const Scalar& x, const Scalar& y,
  3.   typename NumTraits<Scalar>::Real precision =
  4.     NumTraits<Scalar>::dummy_precision())
  5.  
  6. template< .... >
  7. void evalSolverSugarFunction(....)
  8. {
  9.   ....
  10.   const Scalar psPrec = sqrt( test_precision<Scalar>() );
  11.   ....
  12.   if (internal::isApprox(
  13.         calc_realRoots[i], real_roots[j] ), psPrec)
  14.   {
  15.     found = true;
  16.   }
  17.   ....
  18. }
  19.  
  20. This suspicious code was found in Eigen project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V639 Consider inspecting the expression for 'isApprox' function call. It is possible that one of the closing ')' brackets was positioned incorrectly. polynomialsolver.cpp 123
  23.  
  24. 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
Advertisement