[Boost-bugs] [Boost C++ Libraries] #5870: The warning stack is not maintained

Subject: [Boost-bugs] [Boost C++ Libraries] #5870: The warning stack is not maintained
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-05 12:12:31


#5870: The warning stack is not maintained
-------------------------------------------------------+--------------------
 Reporter: Tsukasa Kusakabe <kusakabe@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: |
-------------------------------------------------------+--------------------
 === Problem ===
 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)".

 File list
  * boost/test/utils/nullstream.hpp
  * boost/test/utils/iterator/ifstream_line_iterator.hpp

  === Impact ===
 When the VisualStudio user uses a specific header, a part of a necessary
 warning is not displayed.

  === Reproduction code ===
 {{{
 #!cpp

 #include <boost/config.hpp>
 #pragma warning(error: 4193)

 //boost/test/utils/nullstream.hpp
 #pragma warning(pop) // => warning C4193
 #include <boost/test/utils/nullstream.hpp>
 #pragma warning(pop) // !!! There is not warning. !!!

 //boost/test/utils/iterator/ifstream_line_iterator.hpp
 #pragma warning(pop) // => warning C4193
 #include <boost/test/utils/iterator/ifstream_line_iterator.hpp>
 #pragma warning(pop) // !!! There is not warning. !!!

 int main() {
   return 0;
 }
 }}}

  === Patch ===
 {{{
 #!diff

 Index: boost/program_options/parsers.hpp
 Index: boost/test/utils/iterator/ifstream_line_iterator.hpp
 ===================================================================
 --- boost/test/utils/iterator/ifstream_line_iterator.hpp (revision
 74236)
 +++ boost/test/utils/iterator/ifstream_line_iterator.hpp (working
 copy)
 @@ -86,7 +86,7 @@
  };

  #ifdef BOOST_MSVC
 -# pragma warning(default: 4355)
 +# pragma warning(pop)
  #endif

  typedef basic_ifstream_line_iterator<char> ifstream_line_iterator;
 Index: boost/test/utils/nullstream.hpp
 ===================================================================
 --- boost/test/utils/nullstream.hpp (revision 74236)
 +++ boost/test/utils/nullstream.hpp (working copy)
 @@ -85,7 +85,7 @@
  };

  #ifdef BOOST_MSVC
 -# pragma warning(default: 4355)
 +# pragma warning(pop)
  #endif

  typedef basic_onullstream<char> onullstream;
 }}}

  === Environment ===
  * OS: Windows 7 Professional SP1
  * Compiler:
 {{{
 Microsoft Visual Studio 2010
 Version 10.0.30319.1 RTMRel
 Microsoft .NET Framework
 Version 4.0.30319 RTMRel
 }}}

  === Comments ===
 Division origin #5577

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5870>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC