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]

Re: Warning on C++ catch by value on non primitive types


On Thu, Oct 13, 2005 at 09:41:22AM -0500, Benjamin Kosnik wrote:
> 
> > yeah, if it were in one of those books it could be added to the -weff-c+
> > + option. It doesn't seem sensible to add a different option for an
> > alternative (set of?) coding rule(s).
> 
> FYI this is item 13 in MEC++.

-Weffc++ is broken and should just die.  The coding rules they propose,
and that the flag enforces, are completely incompatible with the STL: you
cannot write a C++ standard library in a way that doesn't either spew tons
of -Weffc++ warnings or that bloats out most of the objects by adding an
unnecessary virtual function table to all kinds of objects that are now a
single pointer (you're pretty much forced to put a virtual destructor in
any class that is inherited from).  That's two pointers instead of one
in most iterators and function objects.

Yes, you can tell the compiler to ignore warnings in system headers,
but then users can't use the same programming techniques that are used
in the STL.

So please don't build anything new on top of this ill-considered warning.


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