3 msgNeed help with optimization options
2 msgstrict aliasing rule and examples
4 msgAnother question. How can I dump gimple IR afte...
4 msgrunning library built in gcc 3.4 on another lin...
1 msgHow to instrument an initcall?
1 msgconst array warning question
3 msgg++ 4.2.x x86: code generation for __sync_lock_...
1 msgHow to traverse through all type declarations i...
2 msgdata base calls
11 msgmay be undefined operation warning

non virtual dtor warning
\ James Tebneff (25 Feb 2008)
. \ Rupert Wood (25 Feb 2008)

3 msggcc-3.4.3 and libstdc++.so.(5|6)
1 msgMigrating from gcc 2.95.3 to 3.4.5 in vxWorks o...
5 msgTarget specific behaviour
4 msgFunction Lookup
6 msginlined functions and ABI guarantees
2 msgCannot compile GCC on Ubuntu 7.10 x86_64
3 msgC main 32/64 bit prologues differ
4 msgForce generation of an uncalled method?
5 msggcc 3.2
Subject:RE: non virtual dtor warning
Group:Gcc-help
From:Rupert Wood
Date:25 Feb 2008


James Tebneff wrote:

> g++-svn -Weffc++ -Wno-non-virtual-dtor t.c
> t.c:2: warning: base class struct A has a non-virtual destructor
:
> Is it possible to use -Wno-non-virtual-dtor or otherwise to disable
> that warning?

You'll find that warning in cp/class.c. It's switched only on -Weffc++:

/* Effective C++ rule 14. We only need to check TYPE_POLYMORPHIC_P
here because the case of virtual functions but non-virtual
dtor is handled in finish_struct_1. */
if (!TYPE_POLYMORPHIC_P (basetype))
warning (OPT_Weffc__,
"base class %q#T has a non-virtual destructor", basetype);

So no, sorry, there's no way to disable that warning individually. -Wnon-virtual-dtor controls another similar warning that (at first glance) is triggered only if there are virtual functions.

Given -Weffc++ in c-opts.c implies -Wnon-virtual-dtor there could be a case for making the above warning conditional on both -Weffc++ and -Wnon-virtual-dtor.

Rup.



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


© 2004-2008 readlist.com