[Bug fortran/81770] New: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 8 13:27:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81770
Bug ID: 81770
Summary: [5/6/7 Regression] Bogus warning: Pointer in pointer
assignment might outlive the pointer target
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: janus at gcc dot gnu.org
Target Milestone: ---
Please consider this test case:
module m
type t
integer, allocatable :: l
end type
contains
subroutine sub(c_in, list)
type(t), target, intent(in) :: c_in
integer, pointer, intent(out) :: list
type(t), pointer :: container
container => c_in
list => container%l
end subroutine
end
Since version 4.8 gfortran with -Wall gives the bogus warning:
list => container%l
1
Warning: Pointer at (1) in pointer assignment might outlive the pointer target
[-Wtarget-lifetime]
More information about the Gcc-bugs
mailing list