Boost C++ Libraries: Ticket #5868: The warning stack is not maintained https://svn.boost.org/trac10/ticket/5868 <h3 class="section" id="Problem">Problem</h3> <p> When "#include" is executed for the following file, the warning stack is destroyed. The cause is a misuse of "#pragma warning(default: warning-number-list)". </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">#include</span> <span class="cpf">&lt;boost/exception/all.hpp&gt;</span><span class="cp"></span> <span class="cp">#pragma warning(error: 4193)</span> <span class="c1">//boost/archive/xml_wiarchive.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/archive/xml_wiarchive.hpp&gt;</span><span class="cp"></span> <span class="cp">#pragma warning(pop) </span><span class="c1">// !!! There is not warning. !!!</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/archive/xml_wiarchive.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/archive/xml_wiarchive.hpp (revision 74236)"> </th> <th title="File boost/archive/xml_wiarchive.hpp (working copy)"> </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>126</th><th>126</th><td class="l"><span>} // namespace boost</span></td> </tr> <tr> <th>127</th><th>127</th><td class="l"><span></span></td> </tr> <tr> <th>128</th><th>128</th><td class="l"><span>#ifdef BOOST_MSVC</span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>129</th><th>&nbsp;</th><td class="l"><span>#&nbsp; pragma warning(push)</span></td> </tr> <tr> <th>130</th><th>&nbsp;</th><td class="l"><span>#&nbsp; pragma warning(disable : 4511 4512)</span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>129</th><td class="r"><span>#pragma warning(pop)</span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>131</th><th>130</th><td class="l"><span>#endif</span></td> </tr> <tr> <th>132</th><th>131</th><td class="l"><span></span></td> </tr> <tr> <th>133</th><th>132</th><td class="l"><span>#include &lt;boost/archive/detail/abi_suffix.hpp&gt; // pops abi_suffix.hpp pragmas</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/5868 Trac 1.4.3 Robert Ramey Sun, 02 Oct 2011 21:09:01 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5868#comment:1 https://svn.boost.org/trac10/ticket/5868#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> That's an easy one. </p> <p> Robert Ramey </p> Ticket