Opened 9 years ago

Last modified 9 years ago

#9315 new Bugs

boost shared_ptr should detect __sync support in clang

Reported by: vlovich@… Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

clang (at least as of 3.4) has support for GCC sync functions. shared_ptr should properly detect that clang has such support (at least on ARM such support is not detected properly).

Change History (4)

comment:1 by viboes, 9 years ago

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 by Peter Dimov, 9 years ago

Most versions of clang appear to provide a working <atomic>, so we'll probably use that instead of the obsolete !__sync intrinsics.

https://github.com/boostorg/smart_ptr/commit/fed15ad8c50921cbfc0365156e4e4f4454dc1b91 allows you to turn std::atomic support on manually by #define BOOST_SP_USE_STD_ATOMIC. This will eventually become the default when std::atomic is autodetected to be present.

comment:3 by Peter Dimov, 9 years ago

As it turns out, sp_has_sync.hpp should already detect the __sync support because Clang defines the macro __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4. What specific problem are you having?

comment:4 by vlovich@…, 9 years ago

The version is the reported field is incorrect (apologies if I supplied it). This bug report was for 1.51. As you point out it's probably fixed in newer boosts.

Note: See TracTickets for help on using tickets.