Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8855 closed Bugs (fixed)

[math] GCC 4.8+ warns unused local typedef...

Reported by: Chris Stylianou <chris5287@…> 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)

math.patch (2.5 KB ) - added by Chris Stylianou <chris5287@…> 9 years ago.
boost-1.54.0-math-unused_typedef.patch (949 bytes ) - added by pmachata@… 9 years ago.
Another unused typedef is in math/distributions/inverse_gaussian.hpp

Download all attachments as: .zip

Change History (7)

by Chris Stylianou <chris5287@…>, 9 years ago

Attachment: math.patch added

by pmachata@…, 9 years ago

Another unused typedef is in math/distributions/inverse_gaussian.hpp

comment:1 by pmachata@…, 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 anonymous, 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 Petr Machata <pmachata@…>, 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 John Maddock, 9 years ago

Resolution: fixed
Status: newclosed

(In [85131]) Fix gcc-4.8.x warnings. Fix some Mingw failures. Fixes #8855.

comment:5 by John Maddock, 9 years ago

(In [85987]) Merge accumulated patches from Trunk. Refs #8384, Refs #8855, refs #9107, refs #9109, refs #8333, refs #8621, refs #8732, refs #8733, refs #8837, refs #8940, refs #9042, refs #9087, refs #9104, refs #9126.

Note: See TracTickets for help on using tickets.