Boost C++ Libraries: Ticket #2264: Warning C4244 in VS2005 build for PocketPC https://svn.boost.org/trac10/ticket/2264 <p> I am getting these two warnings: </p> <p> 1&gt;include\boost/functional/detail/float_functions.hpp(91) : warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data 1&gt;include\boost/functional/detail/float_functions.hpp(118) : warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data </p> <p> They can be easily fixed with an explicit cast to float. These warnings occur in functions call_ldexp and call_frexp in part conditioned with BOOST_HASH_C99_NO_FLOAT_FUNCS and BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2264 Trac 1.4.3 Daniel James Fri, 29 Aug 2008 14:19:01 GMT status changed https://svn.boost.org/trac10/ticket/2264#comment:1 https://svn.boost.org/trac10/ticket/2264#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> An explicit cast wouldn't be a good idea because it can hide potential problems. If that's the only solution, then I'd want to use a macro to only enable it when it's needed. </p> <p> Please can you run the programs attached to the mail at <a class="ext-link" href="http://lists.boost.org/Archives/boost/2005/04/83834.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2005/04/83834.php</a>, and attach the output to this ticket. And the output from <code>libs/config/test/config_info.cpp</code> in boost would also be helpful. That should at least give me an idea of the situation. Thanks. </p> Ticket Juraj Novák <beeblbrox@…> Tue, 02 Sep 2008 08:49:33 GMT attachment set https://svn.boost.org/trac10/ticket/2264 https://svn.boost.org/trac10/ticket/2264 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">output1.txt</span> </li> </ul> <p> Output from test_float1.cpp </p> Ticket Juraj Novák <beeblbrox@…> Tue, 02 Sep 2008 08:50:02 GMT attachment set https://svn.boost.org/trac10/ticket/2264 https://svn.boost.org/trac10/ticket/2264 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">output2.txt</span> </li> </ul> <p> Output from test_float2.cpp </p> Ticket Juraj Novák <beeblbrox@…> Tue, 02 Sep 2008 08:53:05 GMT <link>https://svn.boost.org/trac10/ticket/2264#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:2</guid> <description> <p> It seems the platform does support float versions of math functions. I didn't run config_info.cpp, because my platform is a standard VS2005/PocketPC2003 project running on WM5. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Tue, 02 Sep 2008 10:10:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2264#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:3</guid> <description> <p> I wanted to see the output of config_info so that I could see what macros the platform sets as I don't have access to it myself. But it seems that the best thing to do is always use the c99 functions for the Dinkumware libraries so I'll change it to do that. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Tue, 02 Sep 2008 10:31:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2264#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/48529" title="Always use c99 float function overloads on Dinkumware, as it doesn't ...">[48529]</a>) Always use c99 float function overloads on Dinkumware, as it doesn't always have the C++ overloads. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2264" title="#2264: Bugs: Warning C4244 in VS2005 build for PocketPC (closed: fixed)">#2264</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 08 Sep 2008 21:06:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2264#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/48674" title="Reinstate the old choice of float functions on Dinkumware for all ...">[48674]</a>) Reinstate the old choice of float functions on Dinkumware for all compilers other than Visual C++. </p> <p> It turns out that Borland uses Dinkumware but doesn't have the C99 float overloads, so it only seems realistic to assume their existence on Visual C++. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2264" title="#2264: Bugs: Warning C4244 in VS2005 build for PocketPC (closed: fixed)">#2264</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 11 Sep 2008 09:44:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2264#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:6</guid> <description> <p> Okay, I think the current trunk gets it right, can you test it? If it works for you, I'll merge into release and close this ticket. </p> </description> <category>Ticket</category> </item> <item> <author>Juraj Novák <beeblbrox@…></author> <pubDate>Thu, 11 Sep 2008 13:47:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2264#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2264#comment:7</guid> <description> <p> The code compiles without warning now. I think it is OK. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Thu, 11 Sep 2008 18:28:52 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2264#comment:8 https://svn.boost.org/trac10/ticket/2264#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/48739" title="Always use c99 float function overloads when using Dinkumware with ...">[48739]</a>) Always use c99 float function overloads when using Dinkumware with Visual C++, as it doesn't always have the C++ overloads. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2264" title="#2264: Bugs: Warning C4244 in VS2005 build for PocketPC (closed: fixed)">#2264</a>. </p> <p> Merged revisions 48529,48674 via svnmerge from <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk"><span class="icon">​</span>https://svn.boost.org/svn/boost/trunk</a> </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/48529" title="Always use c99 float function overloads on Dinkumware, as it doesn't ...">r48529</a> | danieljames | 2008-09-02 11:31:26 +0100 (Tue, 02 Sep 2008) | 1 line </p> </blockquote> <p> </p> <blockquote> <p> Always use c99 float function overloads on Dinkumware, as it doesn't always have the C++ overloads. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2264" title="#2264: Bugs: Warning C4244 in VS2005 build for PocketPC (closed: fixed)">#2264</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/48674" title="Reinstate the old choice of float functions on Dinkumware for all ...">r48674</a> | danieljames | 2008-09-08 22:06:16 +0100 (Mon, 08 Sep 2008) | 7 lines </p> </blockquote> <p> </p> <blockquote> <p> Reinstate the old choice of float functions on Dinkumware for all compilers other than Visual C++. </p> </blockquote> <p> </p> <blockquote> <p> It turns out that Borland uses Dinkumware but doesn't have the C99 float overloads, so it only seems realistic to assume their existence on Visual C++. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2264" title="#2264: Bugs: Warning C4244 in VS2005 build for PocketPC (closed: fixed)">#2264</a>. </p> </blockquote> <p> ........ </p> Ticket