Boost logo

Boost :

From: Marius Lazer (Marius.Lazer_at_[hidden])
Date: 2007-07-12 13:21:42


Joaquín,

Here it is (as succinct as I could). All is running on Solaris 10.

Thanks,
Marius

Script to compile with (mk.sh):

echo "with 34 ---------------------------"
/usr/local/gcc-4.1.1/bin/g++ -c m.C -Wsign-promo -I/home/mlazer/boost_1_34_0
echo "with 33 ---------------------------"
/usr/local/gcc-4.1.1/bin/g++ -c m.C -Wsign-promo -I/home/mlazer/boost_1_33_1
echo "DONE ---------------------------"

Source for m.C:

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/hashed_index.hpp>

struct Int
{
   int i() const { return 5; }
};

struct A {};

typedef
boost::multi_index_container
<
   Int,
   boost::multi_index::indexed_by
   <
      boost::multi_index::hashed_unique
      <
         boost::multi_index::tag<A>,
         boost::multi_index::const_mem_fun
         <
            Int,
            int,
            &Int::i
>
>
>
> IndexTest;

Output of the script:
with 34 ---------------------------
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp: In member function 'size_t boost::hash<bool>::operator()(bool) const':
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: passing 'bool' chooses 'int' over 'long unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: passing 'bool' chooses 'int' over 'long int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: passing 'bool' chooses 'int' over 'unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:353: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp: In member function 'size_t boost::hash<unsigned char>::operator()(unsigned char) const':
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: passing 'unsigned char' chooses 'int' over 'long unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: passing 'unsigned char' chooses 'int' over 'long int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: passing 'unsigned char' chooses 'int' over 'unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:356: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp: In member function 'size_t boost::hash<short unsigned int>::operator()(short unsigned int) const':
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: passing 'short unsigned int' chooses 'int' over 'long unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: passing 'short unsigned int' chooses 'int' over 'long int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: in call to 'size_t boost::hash_value(int)'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: passing 'short unsigned int' chooses 'int' over 'unsigned int'
/home/mlazer/boost_1_34_0/boost/functional/hash/hash.hpp:361: warning: in call to 'size_t boost::hash_value(int)'
with 33 ---------------------------
DONE ---------------------------

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of "JOAQUIN LOPEZ MU?Z"
Sent: Thursday, July 12, 2007 11:31 AM
To: boost_at_[hidden]
Subject: Re: [boost] multi-index warnings

----- Mensaje original -----
De: Marius Lazer <Marius.Lazer_at_[hidden]>
Fecha: Jueves, Julio 12, 2007 5:19 pm
Asunto: Re: [boost] multi-index warnings
Para: boost_at_[hidden]

> Joaquín,
>
> I changed one of my key extractors to return an int and no
> warnings. Other extractors return uchar_t, std::string,
> std::basic_string<uchar_t> and no warnings.

That's most weird: the differences in mem_fun.hpp between
1.34 and 1.33.1 do not look like being able to trigger the
warning you report.

Let's do the following: Could you provide me with a *complete*
test program that reproduces the problem, i.e., such that it
compiles warning-free with Boost 1.33.1 and warns with Boost
1.34, along with as much contextual info as possible (GCC
version, command line options, etc.)? If I'm able to reproduce
the problem locally I'll surely spot the reason also.

Thank you,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

**********************************************************************
This communication and all information (including, but not limited to,
 market prices/levels and data) contained therein (the "Information") is
 for informational purposes only, is confidential, may be legally
 privileged and is the intellectual property of ICAP plc and its affiliates
 ("ICAP") or third parties. No confidentiality or privilege is waived or
 lost by any mistransmission. The Information is not, and should not
 be construed as, an offer, bid or solicitation in relation to any
 financial instrument or as an official confirmation of any transaction.
 The Information is not warranted, including, but not limited, as to
 completeness, timeliness or accuracy and is subject to change
 without notice. ICAP assumes no liability for use or misuse of the
 Information. All representations and warranties are expressly
 disclaimed. The Information does not necessarily reflect the views of
 ICAP. Access to the Information by anyone else other than the
 recipient is unauthorized and any disclosure, copying, distribution or
 any action taken or omitted to be taken in reliance on it is prohibited. If
 you receive this message in error, please immediately delete it and all
 copies of it from your system, destroy any hard copies of it and
 notify the sender.
**********************************************************************


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