git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2008, 00:57 UTC
Message-ID
<7vhcb3rfro.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<486FDB2F.3050800@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 20 quoted lines
> 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.

Previous: Ramsay JonesNext: Ramsay Jones
Message 4 of 7 in “Fix some warnings (on cygwin) to allow -Werror”
  1. Fix some warnings (on cygwin) to allow -WerrorRamsay Jones, Jul 3, 2008
  2. Junio C HamanoJul 4, 2008
  3. Ramsay JonesJul 5, 2008
  4. Junio C HamanoJul 6, 2008
  5. Ramsay JonesJul 8, 2008
  6. Steffen ProhaskaJul 4, 2008
  7. Ramsay JonesJul 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.