This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [v3] -Weffc++ fixups


On Wed, Apr 14, 2004 at 07:53:12PM +0200, Paolo Carlini wrote:
> Benjamin Kosnik wrote:
> 
> >I'll wait for comments
>
> Really welcome work!

Agreed, but let's not forget that Scott's recommendations apply 
only to object-oriented code, and the standard library is mostly
not object-oriented.  (I know that bkoz and paolo have not 
forgotten; this is for the lurkers.)

As an example of somebody forgetting this, the regular warning 
mode (by which I mean "-W -Wall") emits a spurious warning about 
a non-virtual destructor in a class with other virtuals.  In some 
contexts that would be helpful, and it almost certainly should be 
emitted when -Weffc++, but I found it very irritating to be forced 
to make the destructor unnecessarily(*) virtual just to shut up the 
damn compiler.

G++ is really remarkably good about spurious warnings, otherwise, 
enough so that normally I can (and do) run "-Werror -W -Wall".

Nathan Myers
ncm-nospam@cantrip.org

(*) In the code in question, the object was always destroyed in a 
context where its true type was known.


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