We have some code that looks roughly like this:
// Two enums that differ entirely.
enum A { a1, a2 };
enum B { b1, b2 };
// Functions to convert in some meaningful way between them
A convert(B);
B convert(A);
Now, our compiler goes and does exactly what we expect it to. convert(a1)
will call B convert(A)
, and so on. However, when we use Lint to look at our code, it complains with error 31. We suspect that this is because the underlying integral type of the enums are the same, and thus Lint might be treating them as such.
The question I have is: is the code standard, or is this an accidental use of a compiler feature?