Opened 11 years ago

Closed 11 years ago

#5869 closed Bugs (fixed)

The warning stack is not maintained

Reported by: Tsukasa Kusakabe <kusakabe@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

Problem

When "#include" is executed for the following file, the warning stack is destroyed. The cause is to have forgotten to write "#pragma warning(pop)".

File list

  • boost/archive/xml_wiarchive.hpp

Impact

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

Reproduction code

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

//boost/program_options/parsers.hpp
#pragma warning(pop) // => warning C4193
#include <boost/program_options/parsers.hpp>
#pragma warning(pop) // !!! There is not warning. !!!

//boost/program_options/variables_map.hpp
#pragma warning(pop) // => warning C4193
#include <boost/program_options/variables_map.hpp>
#pragma warning(pop) // !!! There is not warning. !!!

int main() {
  return 0;
}

Patch

  • boost/program_options/parsers.hpp

     
    260260
    261261}}
    262262
     263#if defined(BOOST_MSVC)
     264#pragma warning (pop)
     265#endif
     266
    263267#undef DECL
    264268
    265269#include "boost/program_options/detail/parsers.hpp"
  • boost/program_options/variables_map.hpp

     
    211211
    212212}}
    213213
     214#if defined(BOOST_MSVC)
     215#   pragma warning (pop)
     216#endif
     217
    214218#endif

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

Change History (1)

comment:1 by Vladimir Prus, 11 years ago

Resolution: fixed
Status: newclosed

I've checked in the patch.

Note: See TracTickets for help on using tickets.