https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90737
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> --- Author: msebor Date: Fri Aug 2 17:05:34 2019 New Revision: 274022 URL: https://gcc.gnu.org/viewcvs?rev=274022&root=gcc&view=rev Log: Backport from mainline PR c/90737 - [8/9/10 Regression] inconsistent address of a local converted to intptr_t between callee and caller gcc/c/ChangeLog: PR c/90737 * c-typeck.c (c_finish_return): Only consider functions returning pointers as candidates for -Wreturn-local-addr. gcc/cp/ChangeLog: PR c/90737 * typeck.c (maybe_warn_about_returning_address_of_local): Only consider functions returning pointers as candidates for -Wreturn-local-addr. gcc/testsuite/ChangeLog: PR c/90737 * c-c++-common/Wreturn-local-addr.c: New test. * g++.dg/warn/Wreturn-local-addr-6.C: New test. Added: branches/gcc-9-branch/gcc/testsuite/c-c++-common/Wreturn-local-addr.c branches/gcc-9-branch/gcc/testsuite/g++.dg/warn/Wreturn-local-addr-6.C Modified: branches/gcc-9-branch/gcc/c/ChangeLog branches/gcc-9-branch/gcc/c/c-typeck.c branches/gcc-9-branch/gcc/cp/ChangeLog branches/gcc-9-branch/gcc/cp/typeck.c branches/gcc-9-branch/gcc/testsuite/ChangeLog