Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#5870 closed Bugs (fixed)

The warning stack is not maintained

Reported by: Tsukasa Kusakabe <kusakabe@…> Owned by: Gennadiy Rozental
Milestone: Boost 1.59.0 Component: test
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/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/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

  • boost/test/utils/iterator/ifstream_line_iterator.hpp

     
    8686};
    8787
    8888#ifdef BOOST_MSVC
    89 # pragma warning(default: 4355)
     89# pragma warning(pop)
    9090#endif
    9191
    9292typedef basic_ifstream_line_iterator<char>      ifstream_line_iterator;
  • boost/test/utils/nullstream.hpp

     
    8585};
    8686
    8787#ifdef BOOST_MSVC
    88 # pragma warning(default: 4355)
     88# pragma warning(pop)
    8989#endif
    9090
    9191typedef 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

Change History (2)

comment:1 by Gennadiy Rozental, 11 years ago

Resolution: fixed
Status: newclosed

(In [75037]) Added missing " # pragma warning(pop) " Fixes #5870

comment:2 by Raffi Enficiaud, 7 years ago

Milestone: To Be DeterminedBoost 1.59.0
Note: See TracTickets for help on using tickets.