Clang's tautological-constant-out-of-range-compare warnings seem broken. It'll warn on enum values, even though they could have casted...
@taradinoc It doesn't matter. The point is that it can easily happen, for example when reading off disk. So this warning is misguided.
-
-
@cmuratori@taradinoc Reading enums off disk is also poor practice, since size of enums is undefined! -
@nothings@cmuratori@taradinoc I assume he meant reading an integer value from disk, then casting to enum type
End of conversation
New conversation -
-
-
@cmuratori Warning for undefined behavior is pretty standard. Why not compare before casting? -
@taradinoc Because you may be doing it in an assertion. Ie., "assert that this enum is in range when I get it". That's extremely common. - Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.