Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2007-01-14 06:23:16


I am getting an annoying warning when building boost_math.dll AND generating Microsoft VS 8.0 'managed' code /clr:pure, even at
warning level 1.

(clr code is needed because we are building a Windows .net form in C# to demonstrate Math function and Statistics Distribution using
John Maddock's Math Toolkit in C++. Aside - with a lot of annoying wrapping, John has made this work).

The message is:

C4793 'vararg' : causes native code generation for function 'void boost::detail::sp_enable_shared_from_this(const
boost::detail::shared_count &,...)'

Adding this #pragma to the top of our boost_math.cpp file does NOT suppress it.

#pragma warning(disable: 4793) // 'vararg' : causes native code generation for function 'void
boost::detail::sp_enable_shared_from_this(const boost::detail::shared_count &,...)'

Is this worrying? Is there something wrong with the pushing and popping of warnings?

Someone has already done some message suppression for SGI I see.

#ifdef sgi
// Turn off: the last argument of the varargs function "sp_enable_shared_from_this" is unnamed
# pragma set woff 3506
#endif

Is this the right way to deal with it for MSVC in shared_prt.hpp?

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4793) // 'vararg' : causes native code generation for function 'void
boost::detail::sp_enable_shared_from_this(const boost::detail::shared_count &,...)'
#endif

inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... )
{
}

#ifdef sgi
# pragma reset woff 3506
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif

With this it gives a clean compile :-))

Could/should this is added to the normal Boost shared_prt.hpp?

Or is there a cleaner solution that avoids vararg?

Paul

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 

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