[Bug sanitizer/108094] gcc trunk's ASAN at -O2 and above did not report a stack-use-after-return
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 14 09:43:07 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108094
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
gcc pr108094.c -g -Wall -Werror -O2
pr108094.c: In function ‘e’:
pr108094.c:8:10: error: function returns address of local variable
[-Werror=return-local-addr]
8 | return c;
| ^
pr108094.c:4:7: note: declared here
4 | int b[1]={0};
| ^
cc1: all warnings being treated as errors
The warning is quite obvious and should not be ignored.
More information about the Gcc-bugs
mailing list