All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Jeff King <peff@peff.net>
Cc: "Vicent Marti" <tanoku@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Torsten Bögershausen" <tboegi@web.de>,
	"GIT Mailing-list" <git@vger.kernel.org>
Subject: [PATCH 5/5] ewah_bitmap.c: Fix printf format warnings on MinGW
Date: Thu, 07 Nov 2013 22:12:57 +0000	[thread overview]
Message-ID: <527C1069.1080000@ramsay1.demon.co.uk> (raw)


On MinGW, gcc complains as follows:

        CC ewah/ewah_bitmap.o
    ewah/ewah_bitmap.c: In function 'ewah_dump':
    ewah/ewah_bitmap.c:389: warning: unknown conversion type \
        character 'z' in format
    ewah/ewah_bitmap.c:389: warning: unknown conversion type \
        character 'z' in format
    ewah/ewah_bitmap.c:389: warning: too many arguments for format
    ewah/ewah_bitmap.c:392: warning: unknown conversion type \
        character 'l' in format
    ewah/ewah_bitmap.c:392: warning: too many arguments for format

In order to suppress the warnings, use the PRIuMAX and PRIx64 macros
from the <inttypes.h> header file.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 ewah/ewah_bitmap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ewah/ewah_bitmap.c b/ewah/ewah_bitmap.c
index 625f5a6..1e363b9 100644
--- a/ewah/ewah_bitmap.c
+++ b/ewah/ewah_bitmap.c
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+#include <inttypes.h>
 
 #include "ewok.h"
 #include "ewok_rlw.h"
@@ -386,10 +387,11 @@ void ewah_iterator_init(struct ewah_iterator *it, struct ewah_bitmap *parent)
 void ewah_dump(struct ewah_bitmap *self)
 {
 	size_t i;
-	fprintf(stderr, "%zu bits | %zu words | ", self->bit_size, self->buffer_size);
+	fprintf(stderr, "%"PRIuMAX" bits | %"PRIuMAX" words | ",
+		(uintmax_t)self->bit_size, (uintmax_t)self->buffer_size);
 
 	for (i = 0; i < self->buffer_size; ++i)
-		fprintf(stderr, "%016llx ", (unsigned long long)self->buffer[i]);
+		fprintf(stderr, "%016"PRIx64" ", (unsigned long long)self->buffer[i]);
 
 	fprintf(stderr, "\n");
 }
-- 
1.8.4

             reply	other threads:[~2013-11-07 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 22:12 Ramsay Jones [this message]
2013-11-07 23:01 ` [PATCH 5/5] ewah_bitmap.c: Fix printf format warnings on MinGW Junio C Hamano

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=527C1069.1080000@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=tanoku@gmail.com \
    --cc=tboegi@web.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.