[Boost-bugs] [Boost C++ Libraries] #3441: boost::pool cast alignment warnings on Sparc

Subject: [Boost-bugs] [Boost C++ Libraries] #3441: boost::pool cast alignment warnings on Sparc
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-12 16:26:56


#3441: boost::pool cast alignment warnings on Sparc
----------------------------------------+-----------------------------------
 Reporter: Evan Jones <evanj@…> | Owner: cnewbold
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: pool
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
----------------------------------------+-----------------------------------
 This may not be fixable, but I generally have been compiling my code on
 Sparc using GCC's -Wcast-align to catch places where code may attempt to
 make an unaligned access. When I use boost::object_pool, I get the
 compiler warnings below. I don't know of any "clean" way to avoid this.
 I've added a pragma to pool.hpp to suppress the warning when this file is
 included.

 System: Solaris 10, Sparc (where alignment matters)
 Compiler: GCC 4.4.0
 Boost: Boost 1.40.0
 Command line: gcc -Wcast-align -c objpooltest.cc -Iboost_1_40_0


 In file included from boost_1_40_0/boost/pool/object_pool.hpp:15,
                  from objpooltest.cc:1:
 boost_1_40_0/boost/pool/pool.hpp: In member function ‘char*&
 boost::details::PODptr<SizeType>::next_ptr() const [with SizeType =
 unsigned int]’:
 boost_1_40_0/boost/pool/pool.hpp:121: instantiated from
 â€˜boost::details::PODptr<SizeType> boost::details::PODptr<SizeType>::next()
 const [with SizeType = unsigned int]’
 boost_1_40_0/boost/pool/object_pool.hpp:116: instantiated from
 â€˜boost::object_pool<T, UserAllocator>::~object_pool() [with T = int,
 UserAllocator = boost::default_user_allocator_new_delete]’
 objpooltest.cc:4: instantiated from here
 boost_1_40_0/boost/pool/pool.hpp:118: warning: cast from ‘char*’ to
 â€˜char**’ increases required alignment of target type
 boost_1_40_0/boost/pool/pool.hpp: In member function ‘SizeType&
 boost::details::PODptr<SizeType>::next_size() const [with SizeType =
 unsigned int]’:
 boost_1_40_0/boost/pool/pool.hpp:121: instantiated from
 â€˜boost::details::PODptr<SizeType> boost::details::PODptr<SizeType>::next()
 const [with SizeType = unsigned int]’
 boost_1_40_0/boost/pool/object_pool.hpp:116: instantiated from
 â€˜boost::object_pool<T, UserAllocator>::~object_pool() [with T = int,
 UserAllocator = boost::default_user_allocator_new_delete]’
 objpooltest.cc:4: instantiated from here
 boost_1_40_0/boost/pool/pool.hpp:116: warning: cast from ‘char*’ to
 â€˜unsigned int*’ increases required alignment of target type

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3441>
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:01 UTC