[Bug middle-end/94312] missing -Wreturn-local-addr on returning local address via memchr or memset
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 24 20:34:45 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94312
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|missing -Wreturn-local-addr |missing -Wreturn-local-addr
|on returning local address |on returning local address
|via memchr |via memchr or memset
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Ditto for memset and strpbrk. The warning should be reviewed for coverage.
Rather than handling just built-ins a more general and more broadly usable
solution is to add a new function attribute to specify that a function returns
either the same value as one of its arguments (unchanged, such as memset), or a
pointer into the same array as one of its arguments (such as memchr).
More information about the Gcc-bugs
mailing list