[Boost-bugs] [Boost C++ Libraries] #7434: Lock used in flyweight causes erroneous "unused variable" warning when compiling with clang

Subject: [Boost-bugs] [Boost C++ Libraries] #7434: Lock used in flyweight causes erroneous "unused variable" warning when compiling with clang
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-27 08:31:07


#7434: Lock used in flyweight causes erroneous "unused variable" warning when
compiling with clang
-------------------------------------------------+--------------------------
 Reporter: Pierre Imai <pierre.imai@…> | Owner: joaquin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: flyweight
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: clang unused variable warning |
-------------------------------------------------+--------------------------
 The lock functionality in boost/flyweight/detail/flyweight_core.hpp causes
 the following warning when compiled with "Apple clang version 4.0
 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)" with option "-Wunused-
 variable":

 {{{
 In file included from /opt/local/include/boost/flyweight/flyweight.hpp:22:
 /opt/local/include/boost/flyweight/detail/flyweight_core.hpp:189:22:
 error: unused variable 'lock' [-Werror,-Wunused-variable]
     lock_type lock(mutex());
 }}}

 This problem can be fixed by adding the following code to the file, before
 / after the corresponding blocks for MSVC

 {{{
 #ifdef __clang__
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-variable"
 #endif
 }}}

 {{{
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7434>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC