This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]