{"thread":{"id":"6324","subject":"[PATCH] Fix warnings on PowerPC - use C99 printf format if available","startedAt":"2007-01-10T04:07:11Z","lastAt":"2007-01-10T06:37:26Z","messageCount":4,"participants":["Pavel Roskin","Junio C Hamano","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31359","messageId":"20070110040710.7403.74668.stgit@localhost.localdomain","threadId":"6324","inReplyTo":null,"subject":"[PATCH] Fix warnings on PowerPC - use C99 printf format if available","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-01-10T04:07:11Z","receivedAt":"2007-01-10T04:07:11Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Signed-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n sha1_file.c |   15 +++++++++++----\n 1 files changed, 11 insertions(+), 4 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 095a7e1..53e25f2 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -22,6 +22,12 @@\n #endif\n #endif\n \n+#ifdef NO_C99_FORMAT\n+#define SZ_FMT \"lu\"\n+#else\n+#define SZ_FMT \"zu\"\n+#endif\n+\n const unsigned char null_sha1[20];\n \n static unsigned int sha1_file_open_flag = O_NOATIME;\n@@ -407,9 +413,9 @@ struct packed_git *packed_git;\n void pack_report()\n {\n \tfprintf(stderr,\n-\t\t\"pack_report: getpagesize()            = %10lu\\n\"\n-\t\t\"pack_report: core.packedGitWindowSize = %10lu\\n\"\n-\t\t\"pack_report: core.packedGitLimit      = %10lu\\n\",\n+\t\t\"pack_report: getpagesize()            = %10\" SZ_FMT \"\\n\"\n+\t\t\"pack_report: core.packedGitWindowSize = %10\" SZ_FMT \"\\n\"\n+\t\t\"pack_report: core.packedGitLimit      = %10\" SZ_FMT \"\\n\",\n \t\tpage_size,\n \t\tpacked_git_window_size,\n \t\tpacked_git_limit);\n@@ -417,7 +423,8 @@ void pack_report()\n \t\t\"pack_report: pack_used_ctr            = %10u\\n\"\n \t\t\"pack_report: pack_mmap_calls          = %10u\\n\"\n \t\t\"pack_report: pack_open_windows        = %10u / %10u\\n\"\n-\t\t\"pack_report: pack_mapped              = %10lu / %10lu\\n\",\n+\t\t\"pack_report: pack_mapped              = \"\n+\t\t\t\"%10\" SZ_FMT \" / %10\" SZ_FMT \"\\n\",\n \t\tpack_used_ctr,\n \t\tpack_mmap_calls,\n \t\tpack_open_windows, peak_pack_open_windows,\n"},{"id":"31360","messageId":"7vk5zvfobp.fsf@assigned-by-dhcp.cox.net","threadId":"6324","inReplyTo":"20070110040710.7403.74668.stgit@localhost.localdomain","subject":"Re: [PATCH] Fix warnings on PowerPC - use C99 printf format if available","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-10T05:22:34Z","receivedAt":"2007-01-10T05:22:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nThis needs a better subject.  I do not see anything PowerPC specific...\n"},{"id":"31361","messageId":"20070110012443.xixagu9e5s04wwss@webmail.spamcop.net","threadId":"6324","inReplyTo":"7vk5zvfobp.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix warnings on PowerPC - use C99 printf format if available","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-01-10T06:24:43Z","receivedAt":"2007-01-10T06:24:43Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Quoting Junio C Hamano <junkio@cox.net>:\n\n> Pavel Roskin <proski@gnu.org> writes:\n>\n> > Signed-off-by: Pavel Roskin <proski@gnu.org>\n>\n> This needs a better subject.  I do not see anything PowerPC specific...\n\nIndeed, it happens on i386 as well (but not on x86_64).  OK, the subject should\nbe:\n\nFix warnings in sha1_file.c - use C99 printf format if available\n\n--\nRegards,\nPavel Roskin\n"},{"id":"31362","messageId":"20070110063726.GD30765@spearce.org","threadId":"6324","inReplyTo":"20070110012443.xixagu9e5s04wwss@webmail.spamcop.net","subject":"Re: [PATCH] Fix warnings on PowerPC - use C99 printf format if available","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-10T06:37:26Z","receivedAt":"2007-01-10T06:37:26Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Pavel Roskin <proski@gnu.org> wrote:\n> Quoting Junio C Hamano <junkio@cox.net>:\n> > Pavel Roskin <proski@gnu.org> writes:\n> >\n> > > Signed-off-by: Pavel Roskin <proski@gnu.org>\n> >\n> > This needs a better subject.  I do not see anything PowerPC specific...\n> \n> Indeed, it happens on i386 as well (but not on x86_64).  OK, the subject should\n> be:\n> \n> Fix warnings in sha1_file.c - use C99 printf format if available\n\nWhen I wrote that code it was warning free on Mac OS X/PowerPC.\nApparently that wasn't true elsewhere.  :-)\nThanks for cleaning up after me.\n\n-- \nShawn.\n"}]}