[atomic] ia32/cmpxchg8b fix

one of my users reported an issue with atomic on gcc/ia32, related to const-correctness. ok to commit this fix? thanks, tim Index: boost/atomic/detail/gcc-x86.hpp =================================================================== --- boost/atomic/detail/gcc-x86.hpp (revision 80433) +++ boost/atomic/detail/gcc-x86.hpp (working copy) @@ -1556,11 +1556,11 @@ template<typename T> T -platform_load64(volatile T * ptr) +platform_load64(const volatile T * ptr) { T expected = *ptr; do { - } while (!platform_cmpxchg64_strong(expected, expected, ptr)); + } while (!platform_cmpxchg64_strong(expected, expected, const_cast<volatile T*>(ptr))); return expected; }

On Friday 07 September 2012 15:05:05 Tim Blechmann wrote:
one of my users reported an issue with atomic on gcc/ia32, related to const-correctness.
ok to commit this fix? [snip] --- boost/atomic/detail/gcc-x86.hpp (revision 80433) +++ boost/atomic/detail/gcc-x86.hpp (working copy) @@ -1556,11 +1556,11 @@
template<typename T> T -platform_load64(volatile T * ptr) +platform_load64(const volatile T * ptr) { T expected = *ptr;
yes, looks both correct and necessary regards Helge
participants (2)
-
Helge Bahmann
-
Tim Blechmann