This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Weffc++ feature request
- From: Mika Heiskanen <Mika dot Heiskanen at fmi dot fi>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 7 Oct 2002 20:35:01 +0300 (EEST)
- Subject: -Weffc++ feature request
Hi,
I would like to be able to access the individual -Weffc++ warnings
directly, mostly due to problems with lefacy code, but also because
the virtual destructor condition rule not really always apply.
I had a quick look at the v3.2 code, and see no problems in extending the
options parser so that each individual warning could be turned on
separately. The hardest problem is probably coming up with a good name for
each individual option, so to get things started here are some
suggestions:
· Item 11: Define a copy constructor and an assignment
operator for classes with dynamically allocated memory.
-Wdynamic-ctor
· Item 12: Prefer initialization to assignment in con
structors.
-Winitialize-ctor
· Item 14: Make destructors virtual in base classes.
-Wvirtual-dtor
· Item 15: Have "operator=" return a reference to "*this".
-Wreturn-this
· Item 23: Don't try to return a reference when you must
return an object.
-Wreturn-object
· Item 6: Distinguish between prefix and postfix forms of
increment and decrement operators.
-Wdistinguish-prefix-postfix
· Item 7: Never overload "&&", "||", or ",".
-Wsuspect-overload
-Weffc++ would naturally be an alias for all the above options.
--> Mika.Heiskanen@fmi.fi
Finnish Meteorological Institute