Opened 10 years ago
#8293 new Bugs
Unused Variable Warnings in Boost.Units due to BOOST_UNITS_STATIC_CONSTANT
Reported by: | ahundt | Owned by: | Matthias Schabel |
---|---|---|---|
Milestone: | To Be Determined | Component: | units |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: |
Description
In clang every globally declared unit using BOOST_UNITS_STATIC_CONSTANT produces an unused variable warning, resulting in hundreds of warnings.
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
Here is one sample:
/opt/local/include/boost/units/static_constant.hpp:27:24: note: expanded from macro 'BOOST_UNITS_STATIC_CONSTANT'
static const type& name = name##_instance_t<true>::instance; \
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);