V2006. Implicit type conversion from enum type to integer type.

This diagnostic warning was added on users' request.

The analyzer allows you to detect all the implicit conversions of enum-types to integer types.

The V2006 diagnostic rule helps perform code refactoring and sometimes find errors.

Here are examples of constructs the analyzer generates this diagnostic message for:

enum Orientation {
  Horizontal = 0x1,
  Vertical = 0x2
};
... 
Orientation orientation = Horizontal;
int pos = orientation; // V2006
if (pos == Vertical) // Ok
{
... 
}

The V2006 diagnostic message is not generated if two values of the enum type are compared or if bitwise operations are executed on them.


Bugs Found

Checked Projects
411
Collected Errors
14 123
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept