https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89284
Bug ID: 89284
Summary: gcc -fsanitize=undefined inhibits -Wuninitialized
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jg at jguk dot org
Target Milestone: ---
Created attachment 45655
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45655&action=edit
test case
Hello
Sanitzer team referred me back to here
https://github.com/google/sanitizers/issues/1045#issuecomment-462197191
test case attached. Is this due to gcc?
$ gcc-8 -Wall -fsanitize=undefined,address -o undef undef.c
undef.c: In function ‘main’:
undef.c:11:13: warning: unused variable ‘b’ [-Wunused-variable]
t_t b = a;
^
jonny@asus:~/code/undef_t$ gcc-8 -Wall -fsanitize=address -o undef undef.c
undef.c: In function ‘main’:
undef.c:11:13: warning: unused variable ‘b’ [-Wunused-variable]
t_t b = a;
^
undef.c:9:15: warning: ‘a.unset.hello’ is used uninitialized in this function
[-Wuninitialized]
if(a.unset.hello)
~~~~~~~^~~~~~
undef.c:11:13: warning: ‘a’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
t_t b = a;
^
jonny@asus:~/code/undef_t$