Opened 7 years ago

Closed 7 years ago

#11661 closed Feature Requests (fixed)

BOOST_NO_UNREACHABLE_RETURN_DETECTION to use __builtin_unreachable()

Reported by: akrzemi1 Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.59.0 Severity: Optimization
Keywords: Cc:

Description

Macro BOOST_NO_UNREACHABLE_RETURN_DETECTION is now defined as:

#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
#  define BOOST_UNREACHABLE_RETURN(x) return x;
#else
#  define BOOST_UNREACHABLE_RETURN(x)
#endif

In order to take the full advantage of the compiler widgets, I think it could be changed to:

#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
#  define BOOST_UNREACHABLE_RETURN(x) return x;
#else if __HAS_BUILTIN_UNREACHABLE
#  define BOOST_UNREACHABLE_RETURN(x) __builtin_unreachable()
#else
#  define BOOST_UNREACHABLE_RETURN(x)
#endif

Change History (1)

comment:1 by John Maddock, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.