PVS-StudioWarnings

PVS-Studio warning V502 for UnrealEngine4

Nov 12th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. class FUniformExpressionSet : public FRefCountedObject
  2. {
  3.   ....
  4.   uint32 GetAllocatedSize() const
  5.   {
  6.     return UniformVectorExpressions.GetAllocatedSize()
  7.       + UniformScalarExpressions.GetAllocatedSize()
  8.       + Uniform2DTextureExpressions.GetAllocatedSize()
  9.       + UniformCubeTextureExpressions.GetAllocatedSize()
  10.       + ParameterCollections.GetAllocatedSize()
  11.       + UniformBufferStruct
  12.           ?
  13.           (sizeof(FUniformBufferStruct) +
  14.            UniformBufferStruct->GetMembers().GetAllocatedSize())
  15.           :
  16.           0;
  17.   }
  18.   ....
  19. };
  20.  
  21. This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '+' operator. materialshared.h 224
  24.  
  25. 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