* [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers)
@ 2012-12-17 19:40 Stefan Weil
2012-12-17 19:44 ` Andreas Färber
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefan Weil @ 2012-12-17 19:40 UTC (permalink / raw)
To: Stefan Hajnoczi, Kevin Wolf; +Cc: Stefan Weil, qemu-devel, Fabien Chouteau
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?
- Stefan
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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers)
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
2012-12-18 13:26 ` Fabien Chouteau
2012-12-18 15:23 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2012-12-17 19:44 UTC (permalink / raw)
To: Stefan Weil; +Cc: Kevin Wolf, Fabien Chouteau, qemu-devel, Stefan Hajnoczi
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers)
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
@ 2012-12-18 13:26 ` Fabien Chouteau
2012-12-18 15:23 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Fabien Chouteau @ 2012-12-18 13:26 UTC (permalink / raw)
To: Stefan Weil; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On 12/17/2012 08:40 PM, Stefan Weil wrote:
> Commit fbcad04d6bfdff937536eb23088a01a280a1a3af added fprintf statements
> with wrong format specifiers.
>
> GetLastError() returns a DWORD which is unsigned long, so %lu must be used.
>
That's right, I didn't see that.
Thanks Stefan,
--
Fabien Chouteau
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] block/raw-win32: Fix compiler warnings (wrong format specifiers)
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
2012-12-18 13:26 ` Fabien Chouteau
@ 2012-12-18 15:23 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-12-18 15:23 UTC (permalink / raw)
To: Stefan Weil; +Cc: Kevin Wolf, Fabien Chouteau, qemu-devel, Stefan Hajnoczi
On Mon, Dec 17, 2012 at 08:40:01PM +0100, Stefan Weil wrote:
> 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?
>
> - Stefan
>
> block/raw-win32.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, applied to the block patches tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-18 15:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-12-18 13:26 ` Fabien Chouteau
2012-12-18 15:23 ` Stefan Hajnoczi
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.