[Bug middle-end/63518] missing Wuninitialized warning independent of order of arguments
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Feb 3 22:24:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63518
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2019-02-03
CC| |msebor at gcc dot gnu.org
Version|unknown |4.7.4
Ever confirmed|0 |1
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.
Both Clang and with -O also GCC 4.7 and later warn on one of the two instances
of the problem. Clang on line 15:
$ clang -S -Wall pr63518.C
pr63518.C:16:9: warning: variable 't' is uninitialized when used here
[-Wuninitialized]
wait(t, setTimeout(t));
^
pr63518.C:15:12: note: initialize the variable 't' to silence this warning
Timeout t;
^
= 0
1 warning generated.
and GCC on line 23:
$ gcc -O -S -Wall pr63518.C
pr63518.C: In function ‘void bar()’:
pr63518.C:23:9: warning: ‘t’ is used uninitialized in this function
[-Wuninitialized]
23 | wait2(setTimeout(t),t);
| ~~~~~^~~~~~~~~~~~~~~~~
More information about the Gcc-bugs
mailing list