Boost C++ Libraries: Ticket #5869: The warning stack is not maintained https://svn.boost.org/trac10/ticket/5869 <h3 class="section" id="Problem">Problem</h3> <p> When "#include" is executed for the following file, the warning stack is destroyed. The cause is to have forgotten to write "#pragma warning(pop)". </p> <p> File list </p> <ul><li>boost/archive/xml_wiarchive.hpp </li></ul><h3 class="section" id="Impact">Impact</h3> <p> When the <a class="missing wiki">VisualStudio</a> user uses a specific header, a part of a necessary warning is not displayed. </p> <h3 class="section" id="Reproductioncode">Reproduction code</h3> <div class="wiki-code"><div class="code"><pre> <span class="cp">#include</span> <span class="cpf">&lt;boost/config.hpp&gt;</span><span class="cp"></span> <span class="cp">#pragma warning(error: 4193)</span> <span class="c1">//boost/program_options/parsers.hpp</span> <span class="cp">#pragma warning(pop) </span><span class="c1">// =&gt; warning C4193</span> <span class="cp">#include</span> <span class="cpf">&lt;boost/program_options/parsers.hpp&gt;</span><span class="cp"></span> <span class="cp">#pragma warning(pop) </span><span class="c1">// !!! There is not warning. !!!</span> <span class="c1">//boost/program_options/variables_map.hpp</span> <span class="cp">#pragma warning(pop) </span><span class="c1">// =&gt; warning C4193</span> <span class="cp">#include</span> <span class="cpf">&lt;boost/program_options/variables_map.hpp&gt;</span><span class="cp"></span> <span class="cp">#pragma warning(pop) </span><span class="c1">// !!! There is not warning. !!!</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><h3 class="section" id="Patch">Patch</h3> <div class="wiki-code"> <div class="diff"> <ul class="entries"> <li class="entry"> <h2> <a>boost/program_options/parsers.hpp</a> </h2> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File boost/program_options/parsers.hpp (revision 74236)"> </th> <th title="File boost/program_options/parsers.hpp (working copy)"> </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>260</th><th>260</th><td class="l"><span></span></td> </tr> <tr> <th>261</th><th>261</th><td class="l"><span>}}</span></td> </tr> <tr> <th>262</th><th>262</th><td class="l"><span></span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>263</th><td class="r"><ins>#if defined(BOOST_MSVC)</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>264</th><td class="r"><ins>#pragma warning (pop)</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>265</th><td class="r"><ins>#endif</ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>266</th><td class="r"><ins></ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>263</th><th>267</th><td class="l"><span>#undef DECL</span></td> </tr> <tr> <th>264</th><th>268</th><td class="l"><span></span></td> </tr> <tr> <th>265</th><th>269</th><td class="l"><span>#include "boost/program_options/detail/parsers.hpp"</span></td> </tr> </tbody> </table> </li> <li class="entry"> <h2> <a>boost/program_options/variables_map.hpp</a> </h2> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File boost/program_options/variables_map.hpp (revision 74236)"> </th> <th title="File boost/program_options/variables_map.hpp (working copy)"> </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>211</th><th>211</th><td class="l"><span></span></td> </tr> <tr> <th>212</th><th>212</th><td class="l"><span>}}</span></td> </tr> <tr> <th>213</th><th>213</th><td class="l"><span></span></td> </tr> </tbody> <tbody class="add"> <tr class="first"> <th>&nbsp;</th><th>214</th><td class="r"><ins>#if defined(BOOST_MSVC)</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>215</th><td class="r"><ins>#&nbsp; &nbsp;pragma warning (pop)</ins></td> </tr> <tr class=""> <th>&nbsp;</th><th>216</th><td class="r"><ins>#endif</ins></td> </tr> <tr class="last"> <th>&nbsp;</th><th>217</th><td class="r"><ins></ins></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>214</th><th>218</th><td class="l"><span>#endif</span></td> </tr> </tbody> </table> </li> </ul> </div></div><h3 class="section" id="Environment">Environment</h3> <ul><li>OS: Windows 7 Professional SP1 </li><li>Compiler: <pre class="wiki">Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel Microsoft .NET Framework Version 4.0.30319 RTMRel </pre></li></ul><h3 class="section" id="Comments">Comments</h3> <p> Division origin <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5577" title="#5577: Bugs: The warning stack is not maintained (closed: invalid)">#5577</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5869 Trac 1.4.3 Vladimir Prus Wed, 19 Oct 2011 16:26:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5869#comment:1 https://svn.boost.org/trac10/ticket/5869#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">fixed</span> </li> </ul> <p> I've checked in the patch. </p> Ticket