Boost C++ Libraries: Ticket #8293: Unused Variable Warnings in Boost.Units due to BOOST_UNITS_STATIC_CONSTANT https://svn.boost.org/trac10/ticket/8293 <p> In clang every globally declared unit using BOOST_UNITS_STATIC_CONSTANT produces an unused variable warning, resulting in hundreds of warnings. </p> <p> Compiler version: c++ --version Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.2.0 Thread model: posix </p> <p> Here is one sample: </p> <blockquote> <p> <sup> </sup></p> </blockquote> <p> /opt/local/include/boost/units/static_constant.hpp:27:24: note: expanded from macro 'BOOST_UNITS_STATIC_CONSTANT' </p> <blockquote> <p> static const type&amp; name = name##_instance_t&lt;true&gt;::instance; \ </p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> In file included from redacted.cpp:18: In file included from redacted2.h:20: In file included from redacted3.h:25: In file included from /opt/local/include/boost/units/systems/si.hpp:24: /opt/local/include/boost/units/systems/si/acceleration.hpp:27:29: warning: unused variable 'metre_per_second_squared' [-Wunused-variable] BOOST_UNITS_STATIC_CONSTANT(metre_per_second_squared,acceleration); </p> <blockquote> <p> <sup> </sup></p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8293 Trac 1.4.3