qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 01/12] block: avoid a write only variable
@ 2010-10-08 21:23 Blue Swirl
  2010-10-11  8:10 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Blue Swirl @ 2010-10-08 21:23 UTC (permalink / raw)
  To: qemu-devel, Kevin Wolf

Compiling with GCC 4.6.0 20100925 produced a warning:
/src/qemu/block/qcow2-refcount.c: In function 'update_refcount':
/src/qemu/block/qcow2-refcount.c:552:13: error: variable 'dummy' set
but not used [-Werror=unused-but-set-variable]

Fix by adding a dummy cast so that the result is not unused.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 block/qcow2-refcount.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 7082601..0efb676 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -551,6 +551,7 @@ fail:
     if (ret < 0) {
         int dummy;
         dummy = update_refcount(bs, offset, cluster_offset - offset, -addend);
+        (void)dummy;
     }

     return ret;
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: [PATCH 01/12] block: avoid a write only variable
  2010-10-08 21:23 [Qemu-devel] [PATCH 01/12] block: avoid a write only variable Blue Swirl
@ 2010-10-11  8:10 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2010-10-11  8:10 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

Am 08.10.2010 23:23, schrieb Blue Swirl:
> Compiling with GCC 4.6.0 20100925 produced a warning:
> /src/qemu/block/qcow2-refcount.c: In function 'update_refcount':
> /src/qemu/block/qcow2-refcount.c:552:13: error: variable 'dummy' set
> but not used [-Werror=unused-but-set-variable]
> 
> Fix by adding a dummy cast so that the result is not unused.
> 
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

Acked-by: Kevin Wolf <kwolf@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-11  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 21:23 [Qemu-devel] [PATCH 01/12] block: avoid a write only variable Blue Swirl
2010-10-11  8:10 ` [Qemu-devel] " Kevin Wolf

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).