Subject: Re: [PATCH 3/3] grep: get rid of useless x < 0 comparison on an enum member

From: Junio C Hamano <[email-masked]>
Date: Mon, 07 Nov 2011 13:48:49 -0800

Jonathan Nieder <[email-masked]> writes:

> So, the purpose of this patch was to work around this common bug in
> static analyzers.

I fail to see how it could be even considered a work around.

If you do not use static analyzers, you do not have to do such a change,
and the resulting code would (not the "negative" side, but the "positive"
side) catch real bugs when somebody screwes up and stuffs a bogus oob
value in p->field.

With the removal of the check, you _have_ to rely on static analyzers to
do the _right thing_, but if you have static analyzers that do the right
thing, you do not have to have such a workaround to begin with.