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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2019-09-29 00:00:00         |2021-4-13
             Blocks|                            |24639

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
No progress in GCC 11 (my bad).  I'll see if I can remember for GCC 12.  Below
is a C test case (in C++ the warning is included in -Wall).

$ (set -x && cat pr90043.c && gcc -S -Wall -Wextra -Wpedantic pr90043.c && gcc
-S -Wall -Wextra -Wpedantic -Winit-self pr90043.c)
+ cat pr90043.c
int f (void)
{
  int i = i;
  return i;
}
+ gcc -S -Wall -Wextra -Wpedantic pr90043.c
+ gcc -S -Wall -Wextra -Wpedantic -Winit-self pr90043.c
pr90043.c: In function ‘f’:
pr90043.c:3:7: warning: ‘i’ is used uninitialized [-Wuninitialized]
    3 |   int i = i;
      |       ^
pr90043.c:3:7: note: ‘i’ was declared here
    3 |   int i = i;
      |       ^


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

Reply via email to