Modify

Ticket #8855 (closed Bugs: fixed)

Opened 9 months ago

Last modified 7 months ago

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

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

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

Change History

Changed 9 months ago by Chris Stylianou <chris5287@…>

Changed 9 months ago by pmachata@…

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

comment:1 Changed 9 months ago by pmachata@…

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 Changed 9 months ago by anonymous

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 Changed 9 months ago by Petr Machata <pmachata@…>

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 Changed 9 months ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:5 Changed 7 months ago by johnmaddock

(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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.