Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81756 - trunk/libs/atomic/test
From: tim_at_[hidden]
Date: 2012-12-07 08:35:25


Author: timblechmann
Date: 2012-12-07 08:35:25 EST (Fri, 07 Dec 2012)
New Revision: 81756
URL: http://svn.boost.org/trac/boost/changeset/81756

Log:
atomic: fix testsuite compilation with -Werror=unused-but-set-variable
Text files modified:
   trunk/libs/atomic/test/ordering.cpp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Modified: trunk/libs/atomic/test/ordering.cpp
==============================================================================
--- trunk/libs/atomic/test/ordering.cpp (original)
+++ trunk/libs/atomic/test/ordering.cpp 2012-12-07 08:35:25 EST (Fri, 07 Dec 2012)
@@ -1,4 +1,5 @@
 // Copyright (c) 2011 Helge Bahmann
+// Copyright (c) 2012 Tim Blechmann
 //
 // Distributed under the Boost Software License, Version 1.0.
 // See accompanying file LICENSE_1_0.txt or copy at
@@ -107,6 +108,8 @@
         timeout = duration;
 }
 
+volatile int backoff_dummy;
+
 template<boost::memory_order store_order, boost::memory_order load_order>
 void
 total_store_order_test<store_order, load_order>::thread1fn(void)
@@ -144,8 +147,7 @@
 
         barrier_.wait();
 
- volatile int tmp;
- while(delay--) { tmp = delay; }
+ while(delay--) { backoff_dummy = delay; }
     }
 }
 
@@ -187,8 +189,7 @@
 
         barrier_.wait();
 
- volatile int tmp;
- while(delay--) { tmp = delay; }
+ while(delay--) { backoff_dummy = delay; }
     }
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk