From: Junio C Hamano Date: Sun, 06 Jul 2008 00:57:15 GMT Subject: Re: [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror Message-ID: <7vhcb3rfro.fsf@gitster.siamese.dyndns.org> In-Reply-To: <486FDB2F.3050800@ramsay1.demon.co.uk> Ramsay Jones writes: > Junio C Hamano wrote: > ... >>> @@ -1718,7 +1720,8 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo >>> static void prepare_pack(int window, int depth) >>> { >>> struct object_entry **delta_list; >>> - uint32_t i, n, nr_deltas; >>> + uint32_t i, nr_deltas; >>> + unsigned n; >> >> Hmm. Is this change necessary? > > Yes, otherwise: > > builtin-pack-objects.c: In function `prepare_pack': > builtin-pack-objects.c:1760: warning: passing arg 2 of `find_deltas' from incompatible pointer type > make: *** [builtin-pack-objects.o] Error 1 > > Note that ll_find_deltas() is #defined to find_deltas() in the #else arm > of #ifdef THREADED_DELTA_SEARCH, and find_deltas() takes an "unsigned *" Ah, I missed that. So it is not just warning squelch but is a bugfix in case unsigned and uint32_t are of different sizes.