Boost C++ Libraries: Ticket #10459: boost::log::v2_mt_nt5::aux::record_pump: function marked as __forceinline not inlined https://svn.boost.org/trac10/ticket/10459 <p> boost/log/sources/record_ostream.hpp(291): warning C4714: </p> <blockquote> <p> 'boost::log::v2_mt_nt5::aux::record_pump': function marked as <span class="underline">forceinline not inlined </span></p> </blockquote> <p> This is generated with MSVC12 warning level 4. Compiling with treat warnings as error is problematic. </p> <p> Attached a fix that disables _forceinline for MSVC: </p> <pre class="wiki">template&lt; typename LoggerT &gt; #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800)) record_pump&lt; LoggerT &gt; make_record_pump( LoggerT&amp; lg, record&amp; rec ) #else BOOST_FORCEINLINE record_pump&lt; LoggerT &gt; make_record_pump(LoggerT&amp; lg, record&amp; rec) #endif { return record_pump&lt; LoggerT &gt;(lg, rec); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10459 Trac 1.4.3 Andrey Semashev Thu, 04 Sep 2014 18:16:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10459#comment:1 https://svn.boost.org/trac10/ticket/10459#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> The warning is disabled for the whole library in boost/log/detail/header.hpp. If the compiler still emits the warning then this is probably a compiler issue. I'm not going to add workarounds for such bugs. You can also disable the warning in the command line. </p> Ticket r.korthaus@… Fri, 05 Sep 2014 08:58:01 GMT <link>https://svn.boost.org/trac10/ticket/10459#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10459#comment:2</guid> <description> <p> Disabled this warning successfully for our Visual Studio project now, which is ok as we do not use _forceinline anywhere in our code. Nevertheless attached is a minimal example that triggers the warning in a freshly generated Visual Studio 2013 project (for the record): </p> <pre class="wiki">#include &lt;stdio.h&gt; #include &lt;tchar.h&gt; #include &lt;boost/log/common.hpp&gt; #include &lt;boost/log/trivial.hpp&gt; int _tmain(int argc, _TCHAR* argv[]) { boost::log::sources::severity_channel_logger_mt&lt; boost::log::trivial::severity_level &gt; logger; BOOST_LOG_CHANNEL_SEV( logger, "A Channel Name", boost::log::trivial::fatal ) &lt;&lt; "fatal error"; return 0; } </pre><p> The warning is triggered by the use of BOOST_LOG_CHANNEL_SEV: </p> <pre class="wiki">&gt;...\boost_1_56_0\include\boost/smart_ptr/intrusive_ptr.hpp(182): warning C4714: "boost::log::v2s_mt_nt5::aux::record_pump&lt;boost::log::v2s_mt_nt5::sources::severity_channel_logger_mt&lt;boost::log::v2s_mt_nt5::trivial::severity_level,std::string&gt;&gt; boost::log::v2s_mt_nt5::aux::make_record_pump&lt;boost::log::v2s_mt_nt5::sources::severity_channel_logger_mt&lt;boost::log::v2s_mt_nt5::trivial::severity_level,std::string&gt;&gt;(LoggerT &amp;,boost::log::v2s_mt_nt5::record &amp;)", function marked as __forceinline not inlined 1&gt; with 1&gt; [ 1&gt; LoggerT=boost::log::v2s_mt_nt5::sources::severity_channel_logger_mt&lt;boost::log::v2s_mt_nt5::trivial::severity_level,std::string&gt; 1&gt; ] 1&gt; ...\boost_1_56_0\include\boost/log/sources/record_ostream.hpp(292): See declaration of 'boost::log::v2s_mt_nt5::aux::make_record_pump' </pre> </description> <category>Ticket</category> </item> </channel> </rss>