qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0
@ 2013-03-27 13:34 Paolo Bonzini
  2013-03-27 20:33 ` Richard Henderson
  2013-03-27 21:15 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-03-27 13:34 UTC (permalink / raw)
  To: qemu-devel

GCC 4.8.0 introduces a new warning:

    block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’:
    block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253'
              locally defined but not used [-Werror=unused-local-typedefs]
         QEMU_BUILD_BUG_ON(offsetof(QCowHeader, snapshots_offset) !=
                  ^
    cc1: all warnings being treated as errors

(Caret diagnostics aren't perfect yet with macros... :)) Work around it
with __attribute__((unused)).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qemu/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 2f7998b..6175c24 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -33,7 +33,7 @@
 #define cat(x,y) x ## y
 #define cat2(x,y) cat(x,y)
 #define QEMU_BUILD_BUG_ON(x) \
-    typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1];
+    typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1] __attribute__((unused));
 
 #if defined __GNUC__
 # if !QEMU_GNUC_PREREQ(4, 4)
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0
  2013-03-27 13:34 [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0 Paolo Bonzini
@ 2013-03-27 20:33 ` Richard Henderson
  2013-03-27 21:15 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2013-03-27 20:33 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 03/27/2013 06:34 AM, Paolo Bonzini wrote:
> GCC 4.8.0 introduces a new warning:
> 
>     block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’:
>     block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253'
>               locally defined but not used [-Werror=unused-local-typedefs]
>          QEMU_BUILD_BUG_ON(offsetof(QCowHeader, snapshots_offset) !=
>                   ^
>     cc1: all warnings being treated as errors
> 
> (Caret diagnostics aren't perfect yet with macros... :)) Work around it
> with __attribute__((unused)).
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Richard Henderson <rth@twiddle.net>

Thanks, I've just been adding -Wno-unused-local-typedefs locally for a bit.


r~

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

* Re: [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0
  2013-03-27 13:34 [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0 Paolo Bonzini
  2013-03-27 20:33 ` Richard Henderson
@ 2013-03-27 21:15 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2013-03-27 21:15 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

Applied.  Thanks.

Regards,

Anthony Liguori

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

end of thread, other threads:[~2013-03-27 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27 13:34 [Qemu-devel] [PATCH] compiler: fix warning with GCC 4.8.0 Paolo Bonzini
2013-03-27 20:33 ` Richard Henderson
2013-03-27 21:15 ` Anthony Liguori

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