Re: Warning about uninitialized members in initializer list

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

 



Hi Mike.

Try
g++ -Wall -Wextra testtest.cpp
testtest.cpp:9: warning: unused parameter '_i'
testtest.cpp:9: warning: unused parameter '_i'

With line 9 the constructor of B.
Both gcc3.4.4 and gcc4.0.1.

However, I thought there would be a warning with
g++ -O3 -Wuninitialized -Winit-self testtest.cpp

Can anybody explain?

Thanks
-- Peter



On Tuesday 09 August 2005 19:29, Mike Rolish wrote:
> class A {
> public:
>     int i;
>     A(int _i) : i(_i) {}
> };
>
> class B : public A {
> public:
>     B(int _i) : A(i) {} // bug, should be A(_i) or shadowing B(int i)
> };



[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