C++ Warning for Base Class Overrides?

Jeffrey Walton noloader@gmail.com
Tue Aug 9 11:38:00 GMT 2011


Hi All,

I'm compiling with -Wall -Wextra on GCC. When I passed the dame code
through ICC, a few functions were flagged as unintentional overrides.
For example:

class Base
{
    void Foo(int);
}

class Derived
{
    void Foo(float);
}

What switch do I need for GCC to warn of the same? The switch I see
(-Woverride-init) does not appear to be what I need.

Jeff



More information about the Gcc-help mailing list