Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for Chromium

Nov 25th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. void Frustum(....)
  2. {
  3.   float delta_x = right - left;
  4.   float delta_y = top - bottom;
  5.   float delta_z = far_z - near_z;
  6.   if ((near_z <= 0.0f) ||
  7.       (far_z <= 0.0f) ||
  8.       (delta_z <= 0.0f) ||
  9.       (delta_y <= 0.0f) ||
  10.       (delta_y <= 0.0f))    <<<<====
  11.     return;
  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 '(delta_y <= 0.0f)' to the left and to the right of the '||' operator. spinning_cube.cc 207
  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
Advertisement