Opened 10 years ago
Closed 10 years ago
#6854 closed Bugs (fixed)
boost/random/detail/integer_log2.hpp:71:35: warning: always_inline function might not be inlinable
Reported by: | Owned by: | No-Maintainer | |
---|---|---|---|
Milestone: | To Be Determined | Component: | random |
Version: | Boost 1.53.0 | Severity: | Regression |
Keywords: | Cc: | mika.fischer@… |
Description
When compiled with GCC 4.7.0, boost/random/detail/integer_log2.hpp triggers a warning:
#include <boost/random/mersenne_twister.hpp> int main() { return 0; }
In file included from boost_1_49_0/include/boost/random/detail/large_arithmetic.hpp:19:0, from boost_1_49_0/include/boost/random/detail/const_mod.hpp:23, from boost_1_49_0/include/boost/random/detail/seed_impl.hpp:27, from boost_1_49_0/include/boost/random/mersenne_twister.hpp:29, from /tmp/always_inline.cpp:1: boost_1_49_0/include/boost/random/detail/integer_log2.hpp:71:35: warning: always_inline function might not be inlinable [-Wattributes]
This warning is due to the missing inline keyword:
--- boost_1_49_0.orig/boost/random/detail/integer_log2.hpp +++ boost_1_49_0/boost/random/detail/integer_log2.hpp @@ -27,7 +27,7 @@ #elif defined(BOOST_MSVC) #define BOOST_RANDOM_DETAIL_CONSTEXPR __forceinline #elif defined(__GNUC__) && __GNUC__ >= 4 -#define BOOST_RANDOM_DETAIL_CONSTEXPR __attribute__((const)) __attribute__((always_inline)) +#define BOOST_RANDOM_DETAIL_CONSTEXPR inline __attribute__((const)) __attribute__((always_inline)) #else #define BOOST_RANDOM_DETAIL_CONSTEXPR inline #endif
Change History (8)
comment:1 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 10 years ago
Cc: | added |
---|
follow-up: 5 comment:4 by , 10 years ago
comment:5 by , 10 years ago
Replying to benjamin.mahler@…:
Replying to anonymous:
Why has this not landed in 1.50.0?
Does not appear to be in 1.51.0 either..
Nor in 1.52.0. What gives?
comment:6 by , 10 years ago
Resolution: | fixed |
---|---|
Severity: | Cosmetic → Regression |
Status: | closed → reopened |
Version: | Boost 1.49.0 → Boost 1.52.0 |
Indeed, still not fixed in 1.52, reopening this ticket.
Adding the suggested inline keyword to integer_log2.hpp fixes this.
/tmp/boost_1_52_0$ /usr/bin/g++-4.7 -I./ -Werror main.cpp In file included from ./boost/random/detail/large_arithmetic.hpp:19:0, from ./boost/random/detail/const_mod.hpp:23, from ./boost/random/detail/seed_impl.hpp:27, from ./boost/random/mersenne_twister.hpp:29, from main.cpp:1: ./boost/random/detail/integer_log2.hpp:71:35: error: always_inline function might not be inlinable [-Werror=attributes] cc1plus: all warnings being treated as errors
comment:7 by , 10 years ago
Version: | Boost 1.52.0 → Boost 1.53.0 |
---|
This is still not fixed in 1.53.0 beta 1.
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.
(In [78513]) Add missing inline. Fixes #6854.