"type" seems to be of type "ResType". Thus, the compiler can assume that it can only hold values defined in the definition of the "ResType" enumeration. 0xFFFF is not such a value. Thus even though you cast the assignment result to "int" it might use that the assignment can never assign 0xFFFF and thus the comparison would be always false.

That's why I would also think that this *might* just hide the warning.