Opened 7 years ago

Last modified 6 years ago

#11779 new Bugs

Boost.Lockfree: Implicit conversion loses integer precision warnings

Reported by: wise.monkey@… Owned by: timblechmann
Milestone: To Be Determined Component: lockfree
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

Xcode Version 7.1 (7B91b)

When using boost::lockfree::queue I get the following implicit conversion warnings:

In file included from /foobar/source/foundation/concurrency/task_queue.cpp:11:
In file included from /foobar/libraries/boost/install.osx/include/boost/lockfree/queue.hpp:21:
In file included from /foobar/libraries/boost/install.osx/include/boost/lockfree/detail/freelist.hpp:23:
In file included from /foobar/libraries/boost/install.osx/include/boost/lockfree/detail/tagged_ptr.hpp:18:
/foobar/libraries/boost/install.osx/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp:59:30: warning: implicit conversion loses integer precision: 'int' to 'tag_t' (aka 'unsigned short') [-Wconversion]
        ret.tag[tag_index] = tag;
                           ~ ^~~
/foobar/libraries/boost/install.osx/include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp:78:13: note: in instantiation of member function 'boost::lockfree::detail::tagged_ptr<boost::lockfree::queue<std::__1::packaged_task<void ()> *, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node>::pack_ptr' requested here
        ptr(pack_ptr(p, t))
            ^
In file included from /foobar/source/foundation/concurrency/task_queue.cpp:11:
/foobar/libraries/boost/install.osx/include/boost/lockfree/queue.hpp:202:15: note: in instantiation of member function 'boost::lockfree::detail::tagged_ptr<boost::lockfree::queue<std::__1::packaged_task<void ()> *, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::node>::tagged_ptr' requested here
        head_(tagged_node_handle(0, 0)),
              ^
/foobar/source/foundation/concurrency/task_queue.cpp:40:29: note: in instantiation of member function 'boost::lockfree::queue<std::__1::packaged_task<void ()> *, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_>::queue' requested here
   TaskQueueContext(void) : Queue(128) {}
}}}                            ^

Change History (2)

comment:1 by Markus, 6 years ago

I get the same warning when using boost::lockfree::stack with boost v 1.63.0, and it is a problem since we have warning-as-errors rules when compiling.

comment:2 by timblechmann, 6 years ago

could you submit a pull request?

Note: See TracTickets for help on using tickets.