qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Weil <sw@weilnetz.de>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Fabien Chouteau <chouteau@adacore.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers)
Date: Mon, 17 Dec 2012 20:44:41 +0100	[thread overview]
Message-ID: <50CF7629.2070309@suse.de> (raw)
In-Reply-To: <1355773201-11576-1-git-send-email-sw@weilnetz.de>

Am 17.12.2012 20:40, schrieb Stefan Weil:
> Commit fbcad04d6bfdff937536eb23088a01a280a1a3af added fprintf statements
> with wrong format specifiers.
> 
> GetLastError() returns a DWORD which is unsigned long, so %lu must be used.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> 
> Do we want those fprintf statements here at all?

I believe it was argued that otherwise you cannot distinguish where the
EIO came from.

Andreas

>  block/raw-win32.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/raw-win32.c b/block/raw-win32.c
> index ce207a3..a2e155e 100644
> --- a/block/raw-win32.c
> +++ b/block/raw-win32.c
> @@ -314,11 +314,11 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset)
>       */
>      dwPtrLow = SetFilePointer(s->hfile, low, &high, FILE_BEGIN);
>      if (dwPtrLow == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) {
> -        fprintf(stderr, "SetFilePointer error: %d\n", GetLastError());
> +        fprintf(stderr, "SetFilePointer error: %lu\n", GetLastError());
>          return -EIO;
>      }
>      if (SetEndOfFile(s->hfile) == 0) {
> -        fprintf(stderr, "SetEndOfFile error: %d\n", GetLastError());
> +        fprintf(stderr, "SetEndOfFile error: %lu\n", GetLastError());
>          return -EIO;
>      }
>      return 0;
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-12-17 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 19:40 [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers) Stefan Weil
2012-12-17 19:44 ` Andreas Färber [this message]
2012-12-18 13:26 ` Fabien Chouteau
2012-12-18 15:23 ` Stefan Hajnoczi

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=50CF7629.2070309@suse.de \
    --to=afaerber@suse.de \
    --cc=chouteau@adacore.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.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).