Opened 9 years ago

Closed 9 years ago

#8693 closed Bugs (fixed)

gcc -Wcast-qual warning in boost/range/algorithm_ext/push_back.hpp

Reported by: ruboam@… Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.53.0 Severity: Cosmetic
Keywords: Cc:

Description

When trying boost range library with -Wcast-qual and -Werror flags enabled the following error comes up boost/range/algorithm_ext/push_back.hpp:30:18: error:

cast from type 'const Range*' to type 'void*' casts away qualifiers [-Werror=cast-qual] BOOST_ASSERT( (void*)&on != (void*)&from && .....

&from is a pointer to const object so the C-style cast (void*)&from casts away of constness. I think this can be fixed by replacing C-style cast by const_cast<void*>(static_cast<const void*>(&from)) or by adding GCC pragmas to disable -Wcast-qual warning in this header file

Change History (2)

comment:1 by Ruben Adamyan <ruboam@…>, 9 years ago

Severity: ProblemCosmetic

comment:2 by Neil Groves, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.