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]

Re: -Weffc++ and -Wold-style-cast


On Sun, Oct 12, 1997 at 07:16:53PM -0700, Joe Buck wrote:
> Silencing -Weffc++ isn't always a good idea; sometimes there is no
> way to do it without making your code worse.  (-Weffc++ forbids
> all derivation from any class with a non-virtual destructor, and 
> the cost of silencing this warning means you have to double the size
> of your smart pointer and envelope-and-letter classes, or otherwise
> add a vtable to an object that doesn't have one just to shut the
> warning up.  I badgered Jason into taking -Weffc++ out of -Wall).

I shudder to think how totally useless -Wall would be if it included
-Weffc++ at this point.  It would do nothing but *encourage* people to use a
lesser warning level if any of their code made use of standard library
stuff.  (Yes, they could always turn -Weffc++ off selectively, but it's more
likely -Wall would be turned off entirely.)

Thanks for the answer.  It doesn't make sense to make sweeping changes to
the library, but unfortunately, these two warning flags are near useless due
to the amount of complaining they do on standard library include files.  I
guess it's really a good thing that they aren't on by default.

-- 
Steve Madsen  <steve@moonglade.com>              PGP key available


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