Opened 11 years ago
Last modified 11 years ago
#6551 new Bugs
BOOST_CLASS_VERSION emits use of old-style cast when compiling with -Wold-style-cast
Reported by: | Owned by: | Aleksey Gurtovoy | |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpl |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
In our project we want to compile all code with -Wold-style-cast and treat warnings as errors. We pass the boost/include directory with -isystem to gcc. This keeps warnings from boost from obfuscating our build output. However if a macro from constains warnings we still get them.
BOOST_CLASS_VERSION uses BOOST_MPL_ASSERT which causes the warning. I changed the old style casts to c++ casts in the macro's from boost/mpl/assert.hpp.
Attachments (1)
Change History (2)
by , 11 years ago
Attachment: | no_old_style_cast_in_macros.patch added |
---|
comment:1 by , 11 years ago
Two things:
- That should be a static_cast, not a reinterpret_cast.
- I wonder if instead of casting a null to an according function pointer type, it would be possible to tell assert_arg explicitly like
assert_arg<void (*)(Pred)>(0, ...)
and then rely on the conversion of 0 to the according type to do the right thing.
Note:
See TracTickets
for help on using tickets.
patch to change old style casts to c++ casts in mpl/assert.hpp