From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Steffen Prohaska <prohaska@zib.de>
Cc: GIT Mailing-list <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH/RFC] Fix some warnings (on cygwin) to allow -Werror
Date: Sat, 05 Jul 2008 21:56:44 +0100 [thread overview]
Message-ID: <486FE00C.7020207@ramsay1.demon.co.uk> (raw)
In-Reply-To: <E4D3A379-9EB2-49D1-AD42-CFFC453A2B08@zib.de>
Steffen Prohaska wrote:
> On Jul 3, 2008, at 5:52 PM, Ramsay Jones wrote:
>
>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
>> ---
>>
>> 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).
>
> For MINGW, we fixed these warnings in the compat layer, see cd800eecc2:
>
> diff --git a/compat/mingw.h b/compat/mingw.h
> index a87cc96..6bc049a 100644
> --- a/compat/mingw.h
> +++ b/compat/mingw.h
> @@ -186,6 +186,10 @@ pid_t mingw_spawnvpe(const char *cmd, const char
> **argv, char **env);
> void mingw_execvp(const char *cmd, char *const *argv);
> #define execvp mingw_execvp
>
> +static inline unsigned int git_ntohl(unsigned int x)
> +{ return (unsigned int)ntohl(x); }
> +#define ntohl git_ntohl
> +
> sig_handler_t mingw_signal(int sig, sig_handler_t handler);
> #define signal mingw_signal
>
Yes, I had something similar at one point (but not in compat).
However, not all of these warnings are solved by the above.
For example, the changes to builtin-fast-export.c, builtin-pack-objects.c,
and pack-check.c do not involve ntohl() at all. (some hunks in other
files do not involve ntohl() either).
When the PRIu32 macro idea was suggested (I think it was Simon 'corecode' Schubert
who first mentioned it), I thought it would look so ugly, no one would
agree to such a patch... Having implemented it, well I guess it's not
quite as bad as I feared ;-) YMMV!
ATB,
Ramsay Jones
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
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 [this message]
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=486FE00C.7020207@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=prohaska@zib.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).