diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-08-20 07:47:46 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-08-20 07:47:46 +0200 |
commit | f657024b85d19eefb046c487a6f7e48bd4905dc9 (patch) | |
tree | 51ca2ece33f0faaea70effd3caefa5961c1fb915 /gcc/fortran/lang.opt | |
parent | a15f1338f99a03da935ecbb1f04097469296e91a (diff) | |
download | gcc-f657024b85d19eefb046c487a6f7e48bd4905dc9.zip gcc-f657024b85d19eefb046c487a6f7e48bd4905dc9.tar.gz gcc-f657024b85d19eefb046c487a6f7e48bd4905dc9.tar.bz2 |
re PR fortran/54301 (Add optional warning if pointer assigning a local variable to a nonlocal pointer)
2012-08-20 Tobias Burnus <burnus@net-b.de>
PR fortran/54301
* expr.c (gfc_check_pointer_assign): Warn when the pointer
might outlive its target.
* gfortran.h (struct gfc_option_t): Add warn_target_lifetime.
* options.c (gfc_init_options, set_wall, gfc_handle_option):
handle it.
* invoke.texi (-Wtarget-lifetime): Document it.
(-Wall): Implied it.
* lang.opt (-Wtarget-lifetime): New flag.
2012-08-20 Tobias Burnus <burnus@net-b.de>
PR fortran/54301
* gfortran.dg/warn_target_lifetime_1.f90: New.
From-SVN: r190522
Diffstat (limited to 'gcc/fortran/lang.opt')
-rw-r--r-- | gcc/fortran/lang.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index e0c7cf7..b38b1e8 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -262,6 +262,10 @@ Wrealloc-lhs-all Fortran Warning Warn when a left-hand-side variable is reallocated +Wtarget-lifetime +Fortran Warning +Warn if the pointer in a pointer assignment might outlive its target + Wreturn-type Fortran Warning ; Documented in C |