Re: [PATCH] Fix a comparison bug in diff-delta.c

From: Pierre Habouzit <madcoder@debian.org>
Date: 2006-08-23 12:38:02
Le mer 23 août 2006 04:32, Pierre Habouzit a écrit :
>   I'm currently trying to make git compile with more strict gcc flags
> (-g -O2 -Wall -Wextra -Wno-unused -Werror to be precise) and I've
> spotted a first bug due to a signed/unsigned comparison.

still in the same kind of "problems" sha1_name.c:512 has:

		if (active_nr < 0)
			return -1;

but active_nr is defined as an unsigned (in cache.h/cache-read.c).

Also note that there is a *lot* of signed/unsigned comparisons due to 
the fact that it's unsigned, and that it's often compared to positions 
that are ints (I assume pos need the negative values to mean "error").

so either those two lines are too much, or active_nr has to be a plain 
signed int. I'm not used to git sources enough yet to be able to make 
the right decision.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Wed Aug 23 12:38:49 2006

This archive was generated by hypermail 2.1.8 : 2006-08-23 12:39:25 EST