#8855 closed Bugs (fixed)
[math] GCC 4.8+ warns unused local typedef...
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
GCC 4.8+ warns unused local typedef...
airy.hpp:343 typedef ‘value_type’ locally defined but not used [-Wunused-local-typedefs]
airy.hpp:349 typedef ‘forwarding_policy’ locally defined but not used [-Wunused-local-typedefs]
airy.hpp:391 typedef ‘value_type’ locally defined but not used [-Wunused-local-typedefs]
airy.hpp:397 typedef ‘forwarding_policy’ locally defined but not used [-Wunused-local-typedefs]
beta.hpp:1334 typedef ‘evaluation_type’ locally defined but not used [-Wunused-local-typedefs]
beta.hpp:1352 typedef ‘evaluation_type’ locally defined but not used [-Wunused-local-typedefs]
Proposed fix attached.
Attachments (2)
Change History (7)
by , 9 years ago
Attachment: | math.patch added |
---|
by , 9 years ago
Attachment: | boost-1.54.0-math-unused_typedef.patch added |
---|
comment:1 by , 9 years ago
There's also one suspicious (unused) typedef in libs/math/test/compile_test/test_compile_result.hpp:
template <class T1, class T2> inline void check_result_imp(T1, T2) { typedef int static_assertion[sizeof(T1) == 0xFFFF]; }
That's kind of reminiscent of static assert, but that should be something like [-(sizeof(T1) == 0xFFFF)] instead. In any case, it's not clear to me what the condition itself is meant to test.
comment:2 by , 9 years ago
I'll get these fixed shortly, the one in test_compile_result.hpp is a static assert that should always fail. It also has to be implemented without including any other header (like static_assert.hpp) as those tests are designed to verify that all the needed headers have been included. I'll add a comment to that effect.
comment:3 by , 9 years ago
In that case I'd go with something like sizeof(T1) != sizeof(T1), as that's guaranteed to fail. But I don't know the code, 0xFFFF may be just as impossible.
I guess the warning is no big deal, since this is for test suite only, but still, it would be nice to have the BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE copied over from static_assert.hpp.
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Another unused typedef is in math/distributions/inverse_gaussian.hpp