Subject: Re: [boost] [boost::noncopyable] compiler warnings with the -Weffc++ flags
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-11 18:08:23
Anand Lakshminath wrote:
> Deriving from the boost::noncopyable class generates warnings when I
> compile with the -Weffc++ (effective C++) flags.
> There are two types of warnings:
> g++ -I/vobs/3rdparty/BOOST/boost_1_38_0/boost_inc -Weffc++ main.cpp
> main.cpp:10: warning: base class 'class
> boost::noncopyable_::noncopyable' has a non-virtual destructor
If you're planning on using Boost at all, you should disable this warning.
Many Boost libraries use inheritance without virtual destructors heavily
and gcc doesn't make it easy to selectively disable spurious warnings.
> main.cpp:10: warning: 'class<unnamed>::DontTreadOnMe' has pointer data members
> main.cpp:10: warning: but does not override
> '<unnamed>::DontTreadOnMe(const <unnamed>::DontTreadOnMe&)'
> main.cpp:10: warning: or 'operator=(const <unnamed>::DontTreadOnMe&)'
> Is there a workaround and/or fix? I am using gcc 4.0.1.
Um. Don't use -Weffc++? Seriously, the code is not broken and
there's nothing we can do to prevent these warnings.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk