If you compile the example from the GCC manual entry for "-Winit-self", you aren't getting any warnings about this. It doesn't work with C++ and C. I tried it with "-Wuninitialized -Winit-self -O1" and also -O2 and -O3, but none showed the warning.
example from GCC 3.4.3 manual: int f() { int i = i; return i; } I used MinGW GCC 3.4.2, that is distributed on www.mingw.net. -- Summary: -Winit-self doesn't work anymore Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: oliverst at online dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19761