Subject: [Boost-bugs] [Boost C++ Libraries] #8120: DONT_USE_HAS_NEW_OPERATOR warning with MSVC and Intel compiler
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-20 01:29:53
#8120: DONT_USE_HAS_NEW_OPERATOR warning with MSVC and Intel compiler
------------------------------------------+---------------------------------
Reporter: hamon <re.mamamia@â¦> | Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
------------------------------------------+---------------------------------
I get the following warning relating to the **DONT_USE_HAS_NEW_OPERATOR**
macro:
{{{
boost/archive/detail/iserializer.hpp(69):
warning #3199: "defined" is always false in a macro expansion in
Microsoft mode
}}}
I can reproduce this warning when using Intel Compiler 13.1 with VS2010.
Previous versions of Intel compiler did not emit this warning.
However the warning appears to be correct as use of **defined** in a macro
expansion is undefined by the standard. I also confirmed with a few tests
that MSVC always evaluates such macros to false.
The solution I am using to fix this warning is to is replace all the uses
of **defined** in the **DONT_USE_HAS_NEW_OPERATOR** macro with a
comparison to 0. For example instead of
{{{
defined(__BORLANDC__)
}}}
use
{{{
__BORLANDC__ != 0
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8120> 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:12 UTC