![]() |
g++ -Weffc++ key and libraries
Hi All!
I read about -Weffc++ key and try to use it to make my code more reliable. But compiler gives me about 1500 warnings for project and most of them located in used libraries: boost, dlib, json_spirit and so on. For example every time then you use boost::noncopyable (class foo : boost::noncopyable ....) you have warning about non-virtual destructor in base class boost::noncopyable. Additional you have warnings about absence of operator= and copy constructor. And so on, so on, so on... - Is boost need some adjusting to support Scott Meyers recommendations? - Is -Weffc++ mode too paranoic? What do you think? |
Re: g++ -Weffc++ key and libraries
crimaniak@googlemail.com wrote:
> Hi All! > > I read about -Weffc++ key What's that? > and try to use it to make my code more > reliable. But compiler gives me about 1500 warnings for project and > most of them located in used libraries: boost, dlib, json_spirit and > so on. For example every time then you use boost::noncopyable (class > foo : boost::noncopyable ....) you have warning about non-virtual > destructor in base class boost::noncopyable. Additional you have > warnings about absence of operator= and copy constructor. And so on, > so on, so on... > > - Is boost need some adjusting to support Scott Meyers > recommendations? You should probably ask in Boost forums. > - Is -Weffc++ mode too paranoic? What's "-Weffc++ mode"? > What do you think? Not much. I've not had my coffee yet. V -- Please remove capital 'A's when replying by e-mail I do not respond to top-posted replies, please don't ask |
Re: g++ -Weffc++ key and libraries
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Victor Bazarov wrote: > crimaniak@googlemail.com wrote: >> Hi All! >> >> I read about -Weffc++ key > > What's that? > > > and try to use it to make my code more >> reliable. But compiler gives me about 1500 warnings for project and >> most of them located in used libraries: boost, dlib, json_spirit and >> so on. For example every time then you use boost::noncopyable (class >> foo : boost::noncopyable ....) you have warning about non-virtual >> destructor in base class boost::noncopyable. Additional you have >> warnings about absence of operator= and copy constructor. And so on, >> so on, so on... >> >> - Is boost need some adjusting to support Scott Meyers >> recommendations? > > You should probably ask in Boost forums. > >> - Is -Weffc++ mode too paranoic? > > What's "-Weffc++ mode"? > >> What do you think? > > Not much. I've not had my coffee yet. > > V - -Weffc++ is some warning about bad C++ programming practice: - - default copy constructor or assignment operator declared in a class with object pointer members - - member not initialised in the member initialisation list in constructor - - non-virtual destructor found in base classes - - returning anything other than *this in operator= - - returning a reference to a local object - - overloading sequence operators Quote from man page: When selecting this option, be aware that the standard library headers do not obey all of these guidelines; use grep -v to filter out those warnings. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAksVIEYACgkQG6NzcAXitM9ZhACgg9V09Dr8up UPl640TYqSEKUp jiIAoItttgVZDpfz3TYuWaDhR/V8fk6N =3NBk -----END PGP SIGNATURE----- |
Re: g++ -Weffc++ key and libraries
On Dec 1, 6:12*am, "criman...@googlemail.com"
<criman...@googlemail.com> wrote: > - Is boost need some adjusting to support Scott Meyers > recommendations? > - Is -Weffc++ mode too paranoic? > What do you think? It's not that it's too paranoid, just that it's a style guide that not all projects follow. There may be no will in various projects to compile cleanly with -Weffc++. Your choices are to either persuade those projects to get -Weffc++-clean (which could be a hard sell), put up with the noise, or just not use that option. For those that don't know, -Weffc++ is a g++ option that warns about violations of some recommendations from the "Effective C++" series. Sean |
Re: g++ -Weffc++ key and libraries
Thanks all for answers!
Now I will try to find how to eliminate some warnings because I still want to use this mode fro my code but don't want to find my errors between tons of unusable warnings from libraries. |
Re: g++ -Weffc++ key and libraries
On Dec 2, 2:45*pm, "criman...@googlemail.com"
<criman...@googlemail.com> wrote: > Thanks all for answers! > > Now I will try to find how to eliminate some warnings because I still > want to use this mode fro my code but don't want to find my errors > between tons of unusable warnings from libraries. Then try gnu.g++.help, not here. This is a question about how to use a specific toolset. |
| All times are GMT. The time now is 11:21 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.