]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c/90737 - [8/9/10 Regression] inconsistent address of a local converted to intptr_...
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Jun 2019 02:53:01 +0000 (02:53 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Jun 2019 02:53:01 +0000 (02:53 +0000)
commit11adab2de399094071b816e7f7dde341c8548af2
tree64d80c6241d50dde32f1122d2cf47c9f5236dad0
parent76af982be878df93ffe66e628328274b5d75ab62
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271985 138bc75d-0d04-0410-961f-82ee72b054a4
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]