On Mon, Nov 07, 2011 at 01:34:02PM -0500, Jeff King wrote: > > The whole point of the statement is a sanity check to uncover bugs. If > > you remove the first condition you completely ruin its point. > [...] > Yes, static analysis can miss some bugs (like passing the address of the > enum through a void pointer (e.g., when memset'ing a struct)). But > couldn't it just as easily be out of range in the other direction? Oops, I just looked at the actual conditional, and it is indeed range-checking the whole enum. So if you are going to do that at all, then yes, checking both sides is sensible, and that is what the original conditional does. Sorry for my confusion. I do still question the value of the check at all, though, given that static analysis can find those bugs. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html