PVS-StudioWarnings

PVS-Studio warning V648 for Wolf

Nov 12th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. inline int operator!=( quat_t a, quat_t b )
  2. {
  3.   return ( ( a.x != b.x ) || ( a.y != b.y ) ||
  4.            ( a.z != b.z ) && ( a.w != b.w ) );
  5. }
  6.  
  7. Most likely this is what should be written here: ( a.z != b.z ) || ( a.w != b.w ).
  8.  
  9. This suspicious code was found in Wolf project by PVS-Studio static code analyzer.
  10. Warning message is:
  11. V648 Priority of the '&&' operation is higher than that of the '||' operation. math_quaternion.h 167
  12.  
  13. 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