Opened 11 years ago

Closed 11 years ago

#5868 closed Bugs (fixed)

The warning stack is not maintained

Reported by: Tsukasa Kusakabe <kusakabe@…> Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
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 a misuse of "#pragma warning(default: warning-number-list)".

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>
#include <boost/exception/all.hpp>
#pragma warning(error: 4193)

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

int main() {
  return 0;
}

Patch

  • boost/archive/xml_wiarchive.hpp

     
    126126} // namespace boost
    127127
    128128#ifdef BOOST_MSVC
    129 #  pragma warning(push)
    130 #  pragma warning(disable : 4511 4512)
     129#pragma warning(pop)
    131130#endif
    132131
    133132#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas

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 Robert Ramey, 11 years ago

Resolution: fixed
Status: newclosed

That's an easy one.

Robert Ramey

Note: See TracTickets for help on using tickets.