Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5577 closed Bugs (invalid)

The warning stack is not maintained

Reported by: Tsukasa Kusakabe <kusakabe@…> Owned by:
Milestone: To Be Determined Component: None
Version: Boost 1.46.1 Severity: Problem
Keywords: Cc:

Description

Problem

When "#include" is executed for the following file, the warning stack is destroyed. The cause forgets to write "#pragma warning(pop)" or is a misuse of "#pragma warning(default: warning-number-list)".

File list

  • boost/spirit/home/classic/core/composite/composite.hpp
  • boost/spirit/home/classic/core/composite/actions.hpp
  • boost/archive/xml_wiarchive.hpp
  • boost/program_options/parsers.hpp
  • boost/program_options/variables_map.hpp
  • 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

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

//boost/spirit/home/classic/core/composite/composite.hpp
#pragma warning(pop) // => warning C4193
#include <boost/spirit/home/classic/core/composite/composite.hpp>
#pragma warning(pop) // !!! There is not warning. !!!

//boost/spirit/home/classic/core/composite/actions.hpp
#pragma warning(pop) // => warning C4193
#include <boost/spirit/home/classic/core/composite/actions.hpp>
#pragma warning(pop) // !!! There is not warning. !!!

//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. !!!

//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. !!!

//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;
}

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
    

Attachments (1)

pragma_warning_stack_bug.patch (3.0 KB ) - added by Tsukasa Kusakabe <kusakabe@…> 11 years ago.
patch

Download all attachments as: .zip

Change History (4)

by Tsukasa Kusakabe <kusakabe@…>, 11 years ago

patch

comment:1 by Michel MORIN <mimomorin@…>, 11 years ago

Resolution: invalid
Status: newclosed

Please make separate tickets for each library (i.e. spirit, serialization, program_options and test). Without this, there is almost no chance to draw authors' attention.

Thanks.

comment:2 by Tsukasa Kusakabe <kusakabe@…>, 11 years ago

separated ticket list:

comment:3 by Michel Morin <mimomorin@…>, 11 years ago

Well, all the tickets were just closed as fixed :-)

Thanks for reporting!

Note: See TracTickets for help on using tickets.