Patchwork [3/3] simpletrace: suppress a warning from unused variable

login
register
mail settings
Submitter Blue Swirl
Date July 23, 2011, 9:25 p.m.
Message ID <CAAu8pHvjmwBCcA_PM2BPj9V9V-R7efS=uwKrTyKszejM+WNziA@mail.gmail.com>
Download mbox | patch
Permalink /patch/106497/
State New
Headers show

Comments

Blue Swirl - July 23, 2011, 9:25 p.m.
Avoid this warning:
  CC    simpletrace.o
/src/qemu/simpletrace.c: In function 'writeout_thread':
/src/qemu/simpletrace.c:122:12: error: variable 'unused' set but not
used [-Werror=unused-but-set-variable]
by adding GCC attribute unused to the variable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 simpletrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

From 78719e173f6ffea9154f013221e26724a79d4507 Mon Sep 17 00:00:00 2001
Message-Id: <78719e173f6ffea9154f013221e26724a79d4507.1311456245.git.blauwirbel@gmail.com>
In-Reply-To: <8bcd08d1fe7c90869ea6659b6248ace6cf7b1f32.1311456245.git.blauwirbel@gmail.com>
References: <8bcd08d1fe7c90869ea6659b6248ace6cf7b1f32.1311456245.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 23 Jul 2011 21:21:14 +0000
Subject: [PATCH 3/3] simpletrace: suppress a warning from unused variable

Avoid this warning:
  CC    simpletrace.o
/src/qemu/simpletrace.c: In function 'writeout_thread':
/src/qemu/simpletrace.c:122:12: error: variable 'unused' set but not used [-Werror=unused-but-set-variable]
by adding GCC attribute unused to the variable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 simpletrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/simpletrace.c b/simpletrace.c
index f1dbb5e..de355e9 100644
--- a/simpletrace.c
+++ b/simpletrace.c
@@ -119,7 +119,7 @@  static void *writeout_thread(void *opaque)
     TraceRecord record;
     unsigned int writeout_idx = 0;
     unsigned int num_available, idx;
-    size_t unused;
+    size_t unused __attribute__ ((unused));
 
     for (;;) {
         wait_for_trace_records_available();
-- 
1.7.2.5