Boost logo

Boost Users :

Subject: Re: [Boost-users] [Multi-Index] Suppressing warnings in VS2005 (VC8)
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2009-04-07 14:31:16


Hi Dominique,

________________________________________
De: boost-users-bounces_at_[hidden] [boost-users-bounces_at_[hidden]] En nombre de Dominique Devienne [ddevienne_at_[hidden]]
Enviado el: martes, 07 de abril de 2009 19:18
Para: boost-users
Asunto: [Boost-users] [Multi-Index] Suppressing warnings in VS2005 (VC8)

> (I'm not sure this is strictly related to Multi-Index in fact)
>
> Hi. If I
>
> #include <boost/multi_index_container.hpp>
> #include <boost/multi_index/random_access_index.hpp>
> #include <boost/multi_index/ordered_index.hpp>
> #include <boost/multi_index/hashed_index.hpp>
> #include <boost/multi_index/composite_key.hpp>
> #include <boost/multi_index/mem_fun.hpp>
>
> I get
>
> boost\detail\allocator_utilities.hpp(182) : warning C4100: 'p' :
> unreferenced formal parameter

I've checked this out, the spurious warning seems to happen
when the elements of the multi_index_container (which are
destroyed via boost::detail::allocator::destroy) are classes with
a trivial destructor.

> If I try to suppress it with:
> [...]
> I get even more warnings (way more).

It' weird, because I tried it myself and the warning indeed
disappears (MSVC 8.0):

#define SUPPRESS_C4100

#ifdef SUPPRESS_C4100
#if defined(_WIN32) && defined( _MSC_VER )
#pragma warning(push)
#pragma warning(disable : 4100) // unreferenced formal parameter
#endif
#endif

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/identity.hpp>

#ifdef SUPPRESS_C4100
#if defined(_WIN32) && defined( _MSC_VER )
#pragma warning(pop)
#endif
#endif

struct foo{};
bool operator<(foo,foo){return false;}

int main()
{
  boost::multi_index_container<foo> c;
}

Can you double check you didn't make any mistake? If the
additional warnings still pop up, can you paste them to a
file and post it?

Also, this should proably be fixed at the level of
boost/detail/allocator_utilities.hpp. If you put a ticket so that I
remember I'll try to get at it in a few days.

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


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