From: Junio C Hamano Date: Mon, 15 Oct 2012 20:53:08 GMT Subject: Re: build deps Message-ID: <7vd30jwj7v.fsf@alter.siamese.dyndns.org> In-Reply-To: <507C2F6E.9060100@drmicha.warpmail.net> Michael J Gruber writes: >> grep.c:451:16: warning: comparison of unsigned enum expression < 0 is >> always false [-Wtautological-compare] >> if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field) >> ~~~~~~~~ ^ ~ >> 1 warning generated. > > Right, that enum type starts at 0. Junio, you last touched this area. > Can we just dump the first comparison or did you have something else in > mind? I think it was a leftover from the very first implementation that defensively said "this has to be one of these known ones", and tried to bound it from both sides of the range, regaredless of the actual type of the field (these GREP_HEADER_WHAT things may have been simple integers with #define'd values). Dropping the "negative" comparison is perfectly fine.