Opened 9 years ago
Closed 9 years ago
#9482 closed Bugs (fixed)
MSVC macros not undefined in boost/move/detail/config_end.hpp
Reported by: | Matthias R | Owned by: | Ion Gaztañaga |
---|---|---|---|
Milestone: | To Be Determined | Component: | move |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Attachments (1)
Change History (2)
by , 9 years ago
Attachment: | boost_move_detail_config_end.patch added |
---|
comment:1 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Sorry for the delay and thanks for the patch. Fixed in commit
SHA-1: 688955ab9b1e022a49c027a8fc6f56ada3ff8e0f