id summary reporter owner description type status milestone component version severity resolution keywords cc 7141 smart_ptr sp_has_sync.hpp should use gcc builtin atomics when available on ARM anonymous Peter Dimov "I am the lucky owner of a Raspberry Pi, and I have been trying to compile some code that uses boost shared_ptr on it (with the Raspbian armhf distro with boost 1.49 and gcc 4.6.3). I get a lot of ""Warning: swp{b} use is deprecated for this architecture"", some of which originate from spinlock_arm_gcc.hpp. I realized that this was fixed in 1.50, but after a bit of looking around I realized that gcc 4.6.3 actually has support for the builtin atomics on this platform, so that sp_has_sync.hpp should make smart_ptr use them instead of trying the assembler stuff in spinlock_arm_gcc.hpp. So I propose the following fix to sp_has_sync.hpp: {{{ #define BOOST_SP_HAS_SYNC + #if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + #if defined( __arm__ ) || defined( __armel__ ) #undef BOOST_SP_HAS_SYNC #endif + #endif // __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 + #if defined( __hppa ) || defined( __hppa__ ) #undef BOOST_SP_HAS_SYNC #endif }}} I maybe more of the platforms can check for the builtins, but I leave that to those who know more about them... Also maybe the ..._SWAP_8 would have to be used for some of them instead? Of course I know that the !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is actually not defined for all gcc versions where the builtins are available, but here we at least will use them when that symbol is defined, rather than not at all. I have written a similar ticket #7140 for boost asio, which suffers a similar problem." Bugs closed To Be Determined smart_ptr Boost 1.51.0 Problem fixed