-Weffc++ and -Wold-style-cast
Joe Buck
jbuck@synopsys.com
Sun Oct 12 19:19:00 GMT 1997
> -Weffc++ and -Wold-style-cast are good ways to clean up old habits and old
> code, but their use is really hurt by the fact that the standard library
> violates their guidelines all over the place. Is anyone working to clean up
> the standard library to make these two flags useful?
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).
And it is SGI, not Cygnus, that is maintaining the STL for everyone; I'm
not sure it's a great idea to fork it to use new casts since they
would all have to be #ifdef'd to run on old compilers also.
So I guess that means the answer is "no one is working on it". I
wouldn't object *provided* that no one makes the code worse (e.g.
by adding a vtable to a class that doesn't need one just to silence
the warning).
More information about the Gcc
mailing list