Boost C++ Libraries: Ticket #2277: Invalid assignment void* to iovec::iov_base on the Solaris https://svn.boost.org/trac10/ticket/2277 <p> On the Solaris following test case cannot be compiled by Sun C++. </p> <pre class="wiki">% cat test.cc #include &lt;boost/asio.hpp&gt; int main() { return 0; }; </pre><pre class="wiki">% CC -V -c -library=stlport4 -I$BOOST test.cc CC: Sun C++ 5.9 SunOS_sparc Patch 124863-06 2008/07/08 $BOOST/boost/asio/detail/socket_ops.hpp", line 218: Error: Cannot assign void* to char*. $BOOST/boost/asio/detail/socket_ops.hpp", line 229: Error: Cannot assign void* to char*. $BOOST/boost/asio/detail/descriptor_ops.hpp", line 66: Error: Cannot assign void* to char*. $BOOST/boost/asio/detail/descriptor_ops.hpp", line 72: Error: Cannot assign void* to char*. </pre><p> The problem exists in the 1.35, 1.36 and trunk. </p> <p> On the Solaris while code compiled by Sun C++ iovec::iov_base field has type caddr_t, which is a typedef, usually for char*. So it is impossible to assign void* to it without explicit cast. </p> <p> Suggested patch is attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2277 Trac 1.4.3 Simon Atanasyan <atanasyan@…> Mon, 01 Sep 2008 18:29:23 GMT attachment set https://svn.boost.org/trac10/ticket/2277 https://svn.boost.org/trac10/ticket/2277 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">asio_sunpro_solaris.patch</span> </li> </ul> <p> Suggested patch </p> Ticket chris_kohlhoff Tue, 02 Sep 2008 12:55:52 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2277#comment:1 https://svn.boost.org/trac10/ticket/2277#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Should have been fixed by changeset <a class="missing ticket">#48525</a>. (Which was purely coincidentally checked in on the same day this item was raised!) </p> <p> However, the intention was that _XOPEN_SOURCE should be defined when building on Solaris. In that case, iov_base is void* as per POSIX specification and older versions of boost.asio work just fine. </p> Ticket