From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: Junio C Hamano <gitster@pobox•com>
Cc: GIT Mailing-list <git@vger•kernel.org>
Subject: Re: [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror
Date: Sat, 05 Jul 2008 21:35:59 +0100 [thread overview]
Message-ID: <486FDB2F.3050800@ramsay1.demon.co.uk> (raw)
In-Reply-To: <7vskuquisp.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
> Ramsay Jones <ramsay@ramsay1•demon.co.uk> writes:
>
>> Despite the subject line, this should be useful on any system for
>> which uint32_t is defined to be unsigned long rather than
>> unsigned int. (and where the return type of htonl() is similarly
>> defined).
>
> Correct. Perhaps "Use %PRIu32 and such to print integers of fixed length"?
>
> The only worry I have with this patch is with systems with not-so-ANSI
> headers; as you noticed, we already have:
>
> #ifndef PRIuMAX
> #define PRIuMAX "llu"
> #endif
>
> in git-compat-util.h, which does include <inttypes.h>, so PRIu32 and
> friends could be problematic on these platforms.
>
Yes, I had the same worry, since I did not know which system(s) required
the above #ifdef and, perhaps more important, why. Having said that, I
suspect (hope?) that the affected system(s) are somewhat rare. I guess
it would not be long before someone complained otherwise...
[Note: I can't just blame the above #ifdef because I don't have a real
git repo ;-) - it would simply blame me!]
>> @@ -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 *"
ATB,
Ramsay Jones
next prev parent reply other threads:[~2008-07-05 22:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 15:52 [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror Ramsay Jones
2008-07-04 8:59 ` Junio C Hamano
2008-07-05 20:35 ` Ramsay Jones [this message]
2008-07-06 0:57 ` Junio C Hamano
2008-07-08 22:21 ` Ramsay Jones
2008-07-04 9:46 ` Steffen Prohaska
2008-07-05 20:56 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=486FDB2F.3050800@ramsay1.demon.co.uk \
--to=ramsay@ramsay1$(echo .)demon.co.uk \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox