https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
--- Comment #7 from Zhendong Su ---
(In reply to Jakub Jelinek from comment #5)
> And -O1 -Wall warns:
> pr106171.c: In function ‘c’:
> pr106171.c:10:15: warning: ‘e[0]’ is used uninitialized [-Wuninitialized]
>10 | return e[0];
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
Zhendong Su changed:
What|Removed |Added
Resolution|--- |INVALID
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
--- Comment #5 from Jakub Jelinek ---
And -O1 -Wall warns:
pr106171.c: In function ‘c’:
pr106171.c:10:15: warning: ‘e[0]’ is used uninitialized [-Wuninitialized]
10 | return e[0];
| ~^~~
pr106171.c:6:9: note: ‘e’ decl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
--- Comment #4 from Jakub Jelinek ---
We don't have uninitialized memory sanitizer.
-fsanitize-address-use-after-scope doesn't trigger because it is use in scope,
just not initialized there.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
--- Comment #3 from Zhendong Su ---
Yes, you're right, Jakub.
Then, it's a false negative for the sanitizers.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171
--- Comment #1 from Zhendong Su ---
Compiler Explorer: https://godbolt.org/z/eEhKn8x9T