Opened 13 years ago
Closed 12 years ago
#3441 closed Bugs (fixed)
boost::pool cast alignment warnings on Sparc
Reported by: | Owned by: | Chris Newbold | |
---|---|---|---|
Milestone: | Boost 1.41.0 | Component: | pool |
Version: | Boost 1.40.0 | Severity: | Problem |
Keywords: | Cc: | boostpool@… |
Description
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
Attachments (1)
Change History (3)
by , 13 years ago
Attachment: | objpooltest.cc added |
---|
comment:1 by , 12 years ago
Cc: | added |
---|
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This appears to have been fixed already in revision [62705].
Minimal test program objpooltest.cc