https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems the difference between C and C++ is documented:
'-Winit-self (C, C++, Objective-C and Objective-C++ only)'
     Warn about uninitialized variables that are initialized with
     themselves.  Note this option can only be used with the
     '-Wuninitialized' option.

     For example, GCC warns about 'i' being uninitialized in the
     following snippet only when '-Winit-self' has been specified:
          int f()
          {
            int i = i;
            return i;
          }

     This warning is enabled by '-Wall' in C++.

We do emit the warning even in C with -W -Wall -Winit-self, and don't emit
it with -W -Wall -Wno-init-self in C++.

Reply via email to