Boost C++ Libraries: Ticket #12478: boost::atomic< char* > generates warning on fetch_add on gcc 4.8+ https://svn.boost.org/trac10/ticket/12478 <p> I have a <code>boost::atomic&lt; char* &gt;</code> object, on which I am calling <code>fetch_add</code> with <code>ptrdiff_t</code>, and apparently only on gcc 4.8+, I am getting the following warning: </p> <pre class="wiki">In file included from /home/foo/packages/boost_1_61_0/include/boost/atomic/detail/atomic_template.hpp:25:0, from /home/foo/packages/boost_1_61_0/include/boost/atomic/atomic.hpp:22, from /home/foo/packages/boost_1_61_0/include/boost/atomic.hpp:12, from /home/foo/code/ThingThatUsesAtomic.h:0, /home/foo/packages/boost_1_61_0/include/boost/atomic/detail/bitwise_cast.hpp: In instantiation of ‘To boost::atomics::detail::bitwise_cast(const From&amp;) [with To = char*; From = long unsigned int]’: /home/foo/packages/boost_1_61_0/include/boost/atomic/detail/atomic_template.hpp:449:59: required from ‘T* boost::atomics::detail::base_atomic&lt;T*, void*&gt;::fetch_add(boost::atomics::detail::base_atomic&lt;T*, void*&gt;::difference_type, boost::memory_order) volatile [with T = char; boost::atomics::detail::base_atomic&lt;T*, void*&gt;::value_type = char*; boost::atomics::detail::base_atomic&lt;T*, void*&gt;::difference_type = long int]’ [ actual code references redacted ... ] /home/foo/packages/boost_1_61_0/include/boost/atomic/detail/bitwise_cast.hpp:41:5: warning: casting ‘char*’ to ‘char&amp;’ does not dereference pointer </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12478 Trac 1.4.3 Andrey Semashev Thu, 05 Jan 2017 02:49:01 GMT owner changed https://svn.boost.org/trac10/ticket/12478#comment:1 https://svn.boost.org/trac10/ticket/12478#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">timblechmann</span> to <span class="trac-author">Andrey Semashev</span> </li> </ul> Ticket Andrey Semashev Fri, 06 Jan 2017 13:38:26 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12478#comment:2 https://svn.boost.org/trac10/ticket/12478#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Should be fixed in <a class="ext-link" href="https://github.com/boostorg/atomic/commit/e6e6a04114997cc96a3c71d18933d5e19f2875e0"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/e6e6a04114997cc96a3c71d18933d5e19f2875e0</a>. </p> Ticket