Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

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

From: Ramsay Jones <hidden>
Date: 2016-06-15 22:44:53

Steffen Prohaska wrote:
quoted hunk ↗ jump to hunk
On Jul 3, 2008, at 5:52 PM, Ramsay Jones wrote:
quoted
Signed-off-by: Ramsay Jones <redacted>
---

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help