public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* -Weffc++ and -Wold-style-cast
@ 1997-10-11 18:06 Steven J. Madsen
  1997-10-12 19:19 ` Joe Buck
  0 siblings, 1 reply; 3+ messages in thread
From: Steven J. Madsen @ 1997-10-11 18:06 UTC (permalink / raw)
  To: EGCS mailing list

-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?

Or... is there a simple way to squelch warnings in system include files?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -Weffc++ and -Wold-style-cast
  1997-10-11 18:06 -Weffc++ and -Wold-style-cast Steven J. Madsen
@ 1997-10-12 19:19 ` Joe Buck
  1997-10-13 21:00   ` Steven J. Madsen
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Buck @ 1997-10-12 19:19 UTC (permalink / raw)
  To: Steven J. Madsen; +Cc: egcs

> -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).




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -Weffc++ and -Wold-style-cast
  1997-10-12 19:19 ` Joe Buck
@ 1997-10-13 21:00   ` Steven J. Madsen
  0 siblings, 0 replies; 3+ messages in thread
From: Steven J. Madsen @ 1997-10-13 21:00 UTC (permalink / raw)
  To: EGCS mailing list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-10-13 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-11 18:06 -Weffc++ and -Wold-style-cast Steven J. Madsen
1997-10-12 19:19 ` Joe Buck
1997-10-13 21:00   ` Steven J. Madsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).