Boost logo

Boost Users :

Subject: Re: [Boost-users] Conversion warning from boost/functional/hash/detail/hash_float_generic.hpp
From: Greg Ward (greg_at_[hidden])
Date: 2010-11-26 15:18:16


On Fri, Nov 19, 2010 I wrote:
> I'm getting a strange warning from
> <boost/functional/hash/detail/hash_float_generic.hpp>.  What's strange
> is not the warning, but the circumstances: if I use the boost headers
> installed in /usr/include, no warning.  But if I make a copy of
> /usr/include/boost and tell the compiler to use the copy, I get a
> warning.
[...]
>
> In file included from include/boost/functional/hash/detail/hash_float.hpp:30,
>                 from include/boost/functional/hash/hash.hpp:15,
>                 from include/boost/functional/hash.hpp:6,
>                 from test.cpp:1:
> include/boost/functional/hash/detail/hash_float_generic.hpp: In
> function ‘size_t boost::hash_detail::float_hash_impl2(T) [with T =
> float]’:
> include/boost/functional/hash/detail/hash_float_generic.hpp:82:
> instantiated from ‘size_t boost::hash_detail::float_hash_impl(T) [with
> T = float]’
> include/boost/functional/hash/detail/hash_float.hpp:74:   instantiated
> from ‘size_t boost::hash_detail::float_hash_value(T) [with T = float]’
> include/boost/functional/hash/hash.hpp:315:   instantiated from here
> include/boost/functional/hash/detail/hash_float_generic.hpp:56:
> warning: conversion to ‘float’ from ‘size_t’ may alter its value
> include/boost/functional/hash/detail/hash_float_generic.hpp:82:
> instantiated from ‘size_t boost::hash_detail::float_hash_impl(T) [with
> T = float]’
> include/boost/functional/hash/detail/hash_float.hpp:74:   instantiated
> from ‘size_t boost::hash_detail::float_hash_value(T) [with T = float]’
> include/boost/functional/hash/hash.hpp:315:   instantiated from here
> include/boost/functional/hash/detail/hash_float_generic.hpp:69:
> warning: conversion to ‘float’ from ‘size_t’ may alter its value

I'm still having no luck here. No idea how to make the warning go
away, except by using the version of boost installed in /usr/local
(e.g.) rather than a symlink to it.

I tried upgrading to GCC 4.4.5 with the same build of boost (1.44.0
built by GCC 4.4.4): no luck. Same result.

I *would* upgrade to boost 1.45.0, but I'm having trouble building it
(working on that in another thread).

Any ideas?

Greg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net