https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90737

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Thu Jun  6 02:53:01 2019
New Revision: 271985

URL: https://gcc.gnu.org/viewcvs?rev=271985&root=gcc&view=rev
Log:
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:
    trunk/gcc/testsuite/c-c++-common/Wreturn-local-addr.c
    trunk/gcc/testsuite/g++.dg/warn/Wreturn-local-addr-6.C
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to