This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54301] Add optional warning if pointer assigning a local variable to a nonlocal pointer
- From: "mikael at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Aug 2012 16:58:54 +0000
- Subject: [Bug fortran/54301] Add optional warning if pointer assigning a local variable to a nonlocal pointer
- Auto-submitted: auto-generated
- References: <bug-54301-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54301
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> 2012-08-17 16:58:54 UTC ---
As always, that's a nice to have feature, but without a thorough control
flow/value range/whatever analysis, it would either give a warning in trivial
cases only or have many false positives.
A warning for b) makes sense to me; for the others:
a) I don't see what prevents a function from returning a short lived
pointer
c) d) The pointer is globally accessible, so I'm not so sure how it could be
nullified or re-associated.