Examples of errors detected by the V673 diagnostic

V673. More than N bits are required to store the value, but the expression evaluates to the T type which can only hold K bits.


.NET CoreCLR

V673 The '0xefefefef << 28' expression evaluates to 1080581331517177856. 60 bits are required to store the value, but the expression evaluates to the 'unsigned' type which can only hold '32' bits. cee_dac _dac object.inl 95


inline void Object::EnumMemoryRegions(void)
{
  ....
  SIZE_T size = sizeof(ObjHeader) + sizeof(Object);
  ....
  size |= 0xefefefef << 28;
  ....
}

size |= SIZE_T(0xefefefef) << 28;

Identical errors can be found in some other places:

  • V673 The '0xefefefef << 28' expression evaluates to 1080581331517177856. 60 bits are required to store the value, but the expression evaluates to the 'unsigned' type which can only hold '32' bits. cee_dac dynamicmethod.cpp 807


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++ and C#

goto PVS-Studio;