{"thread":{"id":"15209","subject":"[PATCH] Fix a warning (on cygwin) to allow -Werror","startedAt":"2008-08-26T17:50:37Z","lastAt":"2008-08-29T06:23:05Z","messageCount":4,"participants":["Ramsay Jones","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"88622","messageId":"48B4426D.3090801@ramsay1.demon.co.uk","threadId":"15209","inReplyTo":null,"subject":"[PATCH] Fix a warning (on cygwin) to allow -Werror","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2008-08-26T17:50:37Z","receivedAt":"2008-08-26T17:50:37Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nNoticed while building 1.6.0 from the release tar-ball.\n\nAlso, I noticed that git_ntohl() is still defined in compat/mingw.h; is this\nstill required?  It's not a problem, just curious! (I don't have mingw\ninstalled, so I can't test myself)\n\nATB,\n\nRamsay Jones\n\n builtin-fast-export.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 0709716..7c93eb8 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -417,7 +417,8 @@ static void export_marks(char *file)\n \tfor (i = 0; i < idnums.size; i++) {\n \t\tif (deco->base && deco->base->type == 1) {\n \t\t\tmark = ptr_to_mark(deco->decoration);\n-\t\t\tfprintf(f, \":%u %s\\n\", mark, sha1_to_hex(deco->base->sha1));\n+\t\t\tfprintf(f, \":%\"PRIu32\" %s\\n\", mark,\n+\t\t\t\tsha1_to_hex(deco->base->sha1));\n \t\t}\n \t\tdeco++;\n \t}\n-- \n1.6.0\n"},{"id":"88699","messageId":"48B508F0.70402@viscovery.net","threadId":"15209","inReplyTo":"48B4426D.3090801@ramsay1.demon.co.uk","subject":"Re: [PATCH] Fix a warning (on cygwin) to allow -Werror","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-27T07:57:36Z","receivedAt":"2008-08-27T07:57:36Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Ramsay Jones schrieb:\n> Also, I noticed that git_ntohl() is still defined in compat/mingw.h; is this\n> still required?  It's not a problem, just curious! (I don't have mingw\n> installed, so I can't test myself)\n\nYes, it's still needed. The reason is that on Windows ntohl() returns\n'unsigned long', and then gcc warns about\n\nsha1_file.c:700: warning: unsigned int format, u_long arg (arg 3)\n\ngit_ntohl() is the workaround.\n\n-- Hannes\n"},{"id":"88920","messageId":"48B6CD9F.6020302@ramsay1.demon.co.uk","threadId":"15209","inReplyTo":"48B508F0.70402@viscovery.net","subject":"Re: [PATCH] Fix a warning (on cygwin) to allow -Werror","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2008-08-28T16:09:03Z","receivedAt":"2008-08-28T16:09:03Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Johannes Sixt wrote:\n> Ramsay Jones schrieb:\n>> Also, I noticed that git_ntohl() is still defined in compat/mingw.h; is this\n>> still required?  It's not a problem, just curious! (I don't have mingw\n>> installed, so I can't test myself)\n> \n> Yes, it's still needed. The reason is that on Windows ntohl() returns\n> 'unsigned long', and then gcc warns about\n> \n> sha1_file.c:700: warning: unsigned int format, u_long arg (arg 3)\n> \n> git_ntohl() is the workaround.\n\nOK, Thanks.\n\nAh, yes, everything works on cygwin and Linux because:\n\n                             Linux           Cygwin\n    ntohl() returns:         uint32_t        uint32_t\n    uint32_t typedef-ed as:  unsigned int    unsigned long\n    PRIu32 #define-d as:     \"u\"             \"lu\"\n\nSo, I suspect (IOW I am guessing that) mingw must have:\n\n    ntohl() returns:         unsigned long (well u_long anyway)\n    uint32_t typedef-ed as:  unsigned int\n    PRIu32 #define-d ad:     \"u\"\n\n(I've just noticed that you are not #include-ing inttypes.h, so you are\nrelying on the PRIu32 defined in git-compat-util.h)\n\nIf the above is true, then well, ... Bummer ;-)\n\nI suppose a (very) slight improvement would be to change the return type\nof your git_ntohl() wrapper to uint32_t. (But we are talking very slight ;-)\n\nATB,\n\nRamsay Jones\n"},{"id":"89088","messageId":"48B795C9.6010009@viscovery.net","threadId":"15209","inReplyTo":"48B6CD9F.6020302@ramsay1.demon.co.uk","subject":"Re: [PATCH] Fix a warning (on cygwin) to allow -Werror","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-08-29T06:23:05Z","receivedAt":"2008-08-29T06:23:05Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Ramsay Jones schrieb:\n> (I've just noticed that you are not #include-ing inttypes.h, so you are\n> relying on the PRIu32 defined in git-compat-util.h)\n\nWe have to: MinGW include files are not C99.\n\n-- Hannes\n"}]}