Boost logo

Boost :

Subject: [boost] [ASIO] Compilation error on NetBSD
From: Marek Dopiera (siersciu_at_[hidden])
Date: 2011-01-13 18:55:43


Hello everybody,
this is my first post to this list.

Recently I got an error when compiling a program which uses ASIO on
NetBSD. It is related to kqueue. From what I see it is caused by
passing descriptor_state* to EV_SET. Under NetBSD it should be
intptr_t. Moreover, the udata field of kevent is implicitly cast to
void* later on, which also causes an error. Explicit casts solve the
issue. Maybe it's worth adding? Could someone with commit access check
it and eventually correct it, please? I don't know how it is under
FreeBSD, maybe an ifdef is needed to support both.

The relevant compilation error (boost-1.44.0, NetBSD 5.1, i386, gcc 4.3.1)
In member function 'void
boost::asio::detail::kqueue_reactor::start_op(int,
boost::asio::detail::socket_type,
boost::asio::detail::kqueue_reactor::descriptor_state*&,
boost::asio::detail::reactor_op*, bool)':
asio/detail/impl/kqueue_reactor.ipp:132: error: invalid conversion
from 'boost::asio::detail::kqueue_reactor::descriptor_state*' to
'__intptr_t'
asio/detail/impl/kqueue_reactor.ipp:136: error: invalid conversion
from 'boost::asio::detail::kqueue_reactor::descriptor_state*' to
'__intptr_t'
asio/detail/impl/kqueue_reactor.ipp:142: error: invalid conversion
from 'boost::asio::detail::kqueue_reactor::descriptor_state*' to
'__intptr_t'
asio/detail/impl/kqueue_reactor.ipp: In member function 'void
boost::asio::detail::kqueue_reactor::run(bool,
boost::asio::detail::op_queue<boost::asio::detail::task_io_service_operation>&)':
asio/detail/impl/kqueue_reactor.ipp:237: error: invalid conversion
from '__intptr_t' to 'void*'
[...]

Regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk