PVS-StudioWarnings

PVS-Studio warning V501 for Chromium

Nov 12th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. Vector3dF
  2. Matrix3F::SolveEigenproblem(Matrix3F* eigenvectors) const
  3. {
  4.   // The matrix must be symmetric.
  5.   const float epsilon = std::numeric_limits<float>::epsilon();
  6.   if (std::abs(data_[M01] - data_[M10]) > epsilon ||
  7.       std::abs(data_[M02] - data_[M02]) > epsilon ||
  8.       std::abs(data_[M12] - data_[M21]) > epsilon) {
  9.     NOTREACHED();
  10.     return Vector3dF();
  11.   }
  12.   ....
  13. }
  14.  
  15. This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V501 There are identical sub-expressions to the left and to the right of the '-' operator: data_[M02] - data_[M02] matrix3_f.cc 128
  18.  
  19. 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