[Multi-Index] Suppressing warnings in VS2005 (VC8)

(I'm not sure this is strictly related to Multi-Index in fact)
Hi. If I
#include

Hi Dominique, ________________________________________ De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de Dominique Devienne [ddevienne@gmail.com] 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
#include #include #include #include #include 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

On Tue, Apr 7, 2009 at 1:31 PM, JOAQUIN M. LOPEZ MUÑOZ
Hi Joaquín,
It' weird, because I tried it myself and the warning indeed disappears (MSVC 8.0):
I can replicate your findings on a small test file.
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?
I did. I can't explain it. There's lots more code following the BMI includes though. I tried to add stuff to your small example to make it behave the same way, but I gave up, I have more productive work to do too ;-) We compile with /W4 /Wp64 BTW.
Also, this should probably 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.
I'll try to find out how to open a ticket. Thanks, --DD

Dominique Devienne escribió:
On Tue, Apr 7, 2009 at 1:31 PM, JOAQUIN M. LOPEZ MUÑOZ
wrote: Hi Joaquín,
It' weird, because I tried it myself and the warning indeed disappears (MSVC 8.0):
I can replicate your findings on a small test file.
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?
I did. I can't explain it. There's lots more code following the BMI includes though.
I tried to add stuff to your small example to make it behave the same way, but I gave up, I have more productive work to do too ;-)
Dominique,
Could you please try replacing your copy of
boost/detail/allocator_utilities.hpp with
the one attached? Do things improve? If so I'll commit this to the trunk.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
/* Copyright 2003-2009 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See Boost website at http://www.boost.org/
*/
#ifndef BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#define BOOST_DETAIL_ALLOCATOR_UTILITIES_HPP
#include
{
};
/* allocator-independent versions of construct and destroy */
template<typename Type>
void construct(void* p,const Type& t)
{
new (p) Type(t);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC++ issues spurious warnings about unreferencend formal parameters
* in destroy<Type> when Type is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename Type>
void destroy(const Type* p)
{
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
const_cast

On Mon, Apr 13, 2009 at 7:11 AM,
Could you please try replacing your copy of boost/detail/allocator_utilities.hpp with the one attached? Do things improve? If so I'll commit this to the trunk.
Hi Joaquín, With your modified allocator_utilities.hpp I now get a clean compile. Thanks for taking the time to fix this! Best regards, --DD
participants (3)
-
Dominique Devienne
-
JOAQUIN M. LOPEZ MUÑOZ
-
joaquin@tid.es