Boost C++ Libraries: Ticket #7434: Lock used in flyweight causes erroneous "unused variable" warning when compiling with clang https://svn.boost.org/trac10/ticket/7434 <p> 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": </p> <pre class="wiki">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()); </pre><p> This problem can be fixed by adding the following code to the file, before / after the corresponding blocks for MSVC </p> <pre class="wiki">#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-variable" #endif </pre><pre class="wiki">#ifdef __clang__ #pragma clang diagnostic pop #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7434 Trac 1.4.3 Joaquín M López Muñoz Mon, 26 Aug 2013 18:17:59 GMT <link>https://svn.boost.org/trac10/ticket/7434#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7434#comment:1</guid> <description> <p> Hi Pierre, </p> <p> Can you provide me with two bits of additional info? </p> <ul><li>Can you check the values of <span class="underline">clang_major</span> and <span class="underline">clang_minor</span>? I'd like make the patch using BOOST_WORKAROUND and BOOST_TESTED_AT so as to record the specific version of Clang where this is happening. </li><li>Do you have access to GCC in your environment? Does the equivalent warning happen? </li></ul><p> Thank you, </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joaquín M López Muñoz</dc:creator> <pubDate>Wed, 29 Jan 2020 09:03:09 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7434#comment:2 https://svn.boost.org/trac10/ticket/7434#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Can't fix due to lack of feedback from reporter. </p> Ticket