[Boost-bugs] [Boost C++ Libraries] #9482: MSVC macros not undefined in boost/move/detail/config_end.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #9482: MSVC macros not undefined in boost/move/detail/config_end.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-10 13:12:25


#9482: MSVC macros not undefined in boost/move/detail/config_end.hpp
------------------------------+------------------------
 Reporter: Matthias R | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: move
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------
 Boost.Move defines several macros in boost/move/detail/config_begin.hpp to
 silence MSVC warnings. The corresponding cleanup code in
 boost/move/detail/config_end.hpp is incorrect and fails to properly
 undefine these macros:

 {{{
 #if defined BOOST_MSVC
    #pragma warning (pop)
    #ifdef BOOST_MOVE_DETAIL_CRT_SECURE_NO_DEPRECATE
       #undef BOOST_MOVE_DETAIL_CRT_SECURE_NO_DEPRECATE
       #undef _CRT_SECURE_NO_DEPRECATE
    #endif
    #ifndef BOOST_MOVE_SCL_SECURE_NO_WARNINGS
       #undef BOOST_MOVE_SCL_SECURE_NO_WARNINGS
       #undef _SCL_SECURE_NO_WARNINGS
    #endif
 #endif
 }}}

 A correct implementation would be
 {{{
 #if defined BOOST_MSVC
    #pragma warning (pop)
    #ifdef BOOST_MOVE_CRT_SECURE_NO_DEPRECATE
       #undef BOOST_MOVE_CRT_SECURE_NO_DEPRECATE
       #undef _CRT_SECURE_NO_DEPRECATE
    #endif
    #ifdef BOOST_MOVE_SCL_SECURE_NO_WARNINGS
       #undef BOOST_MOVE_SCL_SECURE_NO_WARNINGS
       #undef _SCL_SECURE_NO_WARNINGS
    #endif
 #endif
 }}}

 This is quite problematic as the current version either undefines a
 previously defined macro, or leaks the macro definition, both of which
 lead to surprising behavior.

 A patch against current trunk is attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9482>
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:15 UTC