PR c/90737 - [8/9/10 Regression] inconsistent address of a local converted to intptr_...
authorMartin Sebor <msebor@redhat.com>
Thu, 6 Jun 2019 02:53:01 +0000 (02:53 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 6 Jun 2019 02:53:01 +0000 (20:53 -0600)
commit65985d787504047cb0a82947f7287138b0c54bc5
tree64d80c6241d50dde32f1122d2cf47c9f5236dad0
parent3146ec83db7e65982776a979b8c75883202a4e90
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.

From-SVN: r271985
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wreturn-local-addr.c [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wreturn-local-addr-6.C [new file with mode: 0644]