Boost C++ Libraries: Ticket #6551: BOOST_CLASS_VERSION emits use of old-style cast when compiling with -Wold-style-cast https://svn.boost.org/trac10/ticket/6551 <p> 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. </p> <p> 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. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6551 Trac 1.4.3 andre.kwakernaak@… Mon, 13 Feb 2012 09:31:39 GMT attachment set https://svn.boost.org/trac10/ticket/6551 https://svn.boost.org/trac10/ticket/6551 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">no_old_style_cast_in_macros.patch</span> </li> </ul> <p> patch to change old style casts to c++ casts in mpl/assert.hpp </p> Ticket Ulrich Eckhardt <ulrich.eckhardt@…> Tue, 14 Feb 2012 08:17:52 GMT <link>https://svn.boost.org/trac10/ticket/6551#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6551#comment:1</guid> <description> <p> Two things: </p> <ol><li>That should be a static_cast, not a reinterpret_cast. </li><li>I wonder if instead of casting a null to an according function pointer type, it would be possible to tell assert_arg explicitly like <code>assert_arg&lt;void (*)(Pred)&gt;(0, ...)</code> and then rely on the conversion of 0 to the according type to do the right thing. </li></ol> </description> <category>Ticket</category> </item> </channel> </rss>