Opened 5 years ago

Last modified 4 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:


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).

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by viboes

Component: Nonesmart_ptr
Owner: set to Peter Dimov

comment:2 Changed 5 years ago by Peter Dimov

Most versions of clang appear to provide a working <atomic>, so we'll probably use that instead of the obsolete !__sync intrinsics. 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 Changed 4 years ago by Peter Dimov

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 Changed 4 years ago by vlovich@…

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.

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Peter Dimov.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.