Opened 7 years ago

Last modified 6 years ago

#12144 reopened Bugs

Clang 3.9 trunk DONT_USE_HAS_NEW_OPERATOR warning

Reported by: drivehappy@… Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Clang 3.9 is reporting the following warning:

boost/boost.1.58.0/boost/archive/detail/iserializer.hpp:65:7: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if ! DONT_USE_HAS_NEW_OPERATOR
      ^
boost/boost.1.58.0/boost/archive/detail/iserializer.hpp:61:5: note: expanded from macro 'DONT_USE_HAS_NEW_OPERATOR'
    defined(__BORLANDC__)                              \
    ^

I believe this may have been initially fixed with: https://svn.boost.org/trac/boost/ticket/8120

Changing the source to not directly #define on #defined seems to resolve this warning:

#ifndef BOOST_MSVC
	#if BOOST_WORKAROUND(__IBMCPP__, < 1210)               \
            || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590)
		#define DONT_USE_HAS_NEW_OPERATOR 1
	#else
		#define DONT_USE_HAS_NEW_OPERATOR 0
	#endif
#else
    #define DONT_USE_HAS_NEW_OPERATOR 0
#endif

Change History (5)

comment:1 by anonymous, 7 years ago

jlkj

comment:2 by Robert Ramey, 6 years ago

Resolution: fixed
Status: newclosed

comment:3 by drivehappy@…, 6 years ago

I noticed this was transitioned as Fixed, however I don't see a change in either the 'develop' or 'master' branches on GitHub - is there a different branch it was resolved in? Thanks.

comment:4 by drivehappy@…, 6 years ago

Resolution: fixed
Status: closedreopened

Re-opening as it doesn't seem to be resolved (at least looking in github master or develop branch): https://github.com/boostorg/serialization/blob/master/include/boost/archive/detail/iserializer.hpp

The fixed transition doesn't have any notes on any change, so I'm working on the assumption this was incorrectly closed out.

comment:5 by davidlt, 6 years ago

Boost 1.63.0 and Clang 4.0.0 continues to have these warnings (or errors in our configuration).

Note: See TracTickets for help on using tickets.