Subject: [Boost-bugs] [Boost C++ Libraries] #12478: boost::atomic< char* > generates warning on fetch_add on gcc 4.8+
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-23 17:50:45
#12478: boost::atomic< char* > generates warning on fetch_add on gcc 4.8+
--------------------------------------+--------------------------
Reporter: Matt Hauck <matthauck@â¦> | Owner: timblechmann
Type: Bugs | Status: new
Milestone: To Be Determined | Component: atomic
Version: Boost 1.61.0 | Severity: Problem
Keywords: |
--------------------------------------+--------------------------
I have a `boost::atomic< char* >` object, on which I am calling
`fetch_add` with `ptrdiff_t`, and apparently only on gcc 4.8+, I am
getting the following warning:
{{{
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&)
[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<T*,
void*>::fetch_add(boost::atomics::detail::base_atomic<T*,
void*>::difference_type, boost::memory_order) volatile [with T = char;
boost::atomics::detail::base_atomic<T*, void*>::value_type = char*;
boost::atomics::detail::base_atomic<T*, void*>::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&â does not dereference pointer
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12478> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC