Redundant warning with -Weffc++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, when I compile the code below with -Weffc++ I get warnings about the initialization list.

class Foo {
public:
        Foo(): x(0), y(0){
        }

private:
        union {
                struct {
                        float x;
                        float y;
                };
                float v[2];
        };
};

initialization.cpp: In constructor ‘Foo::Foo()’:
initialization.cpp:3: warning: ‘Foo::<anonymous>’ should be initialized in the member initialization list initialization.cpp:3: warning: ‘Foo::<anonymous union>::<anonymous>’ should be initialized in the member initialization list

I don't think this warning is correct as all memory has been initalized correctly. Is there a way to work around this or to disable only this warning?

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux