Boost C++ Libraries: Ticket #13124: Boost Multiprecision: Compilation error on MSVC2017 with MPIR 3.0.0 https://svn.boost.org/trac10/ticket/13124 <p> I'm getting the following compilation error when attempting to use MPIR 3.0.0 as backend for Boost Multiprecision: </p> <pre class="wiki">C:\dev\boost\boost\multiprecision\gmp.hpp(1008): error C2664: 'double __gmpf_get_d_2exp(long *,mpf_srcptr)': cannot convert argument 1 from 'mpir_si *' to 'long *' C:\dev\boost\boost/multiprecision/gmp.hpp(1008): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast </pre><p> I've also confirmed that this issue doesn't happen on the previous MPIR release (2.7.2). </p> <p> At the moment, changing the version guard here: </p> <pre class="wiki">template &lt;unsigned Digits10&gt; inline void eval_frexp(gmp_float&lt;Digits10&gt;&amp; result, const gmp_float&lt;Digits10&gt;&amp; val, long* e) { #if BOOST_MP_MPIR_VERSION &gt;= 20600 mpir_si v; mpf_get_d_2exp(&amp;v, val.data()); *e = v; eval_ldexp(result, val, -v); #else mpf_get_d_2exp(e, val.data()); eval_ldexp(result, val, -*e); #endif } </pre><p> to: </p> <pre class="wiki">#if BOOST_MP_MPIR_VERSION &gt;= 20600 &amp;&amp; BOOST_MP_MPIR_VERSION &lt; 30000 </pre><p> eliminates the error, though I don't know enough about this to determine whether more changes will be needed (like the similar looking guard in the int* overload of this function). </p> <p> The issue also occurs in Boost v1.65 beta 1, so I assume it hasn't been fixed yet. I'm guessing this is a consequence of the fix from <a class="ext-link" href="https://svn.boost.org/trac10/ticket/12234"><span class="icon">​</span>https://svn.boost.org/trac10/ticket/12234</a>. </p> <p> I just used gmp_snips.cpp from the Boost examples to reproduce this, so I won't attach the code here. </p> <p> <strong>For reference:</strong> all of the stated tests and the MPIR sources were compiled on MSVC2017 (x64, Debug), but I doubt that would change anything. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13124 Trac 1.4.3 John Maddock Sat, 30 Dec 2017 19:47:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13124#comment:1 https://svn.boost.org/trac10/ticket/13124#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> Thanks for the heads up: fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/c78c91f499655e06c31257b90f56bb775202719e"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/c78c91f499655e06c31257b90f56bb775202719e</a> </p> Ticket