http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55476



             Bug #: 55476

           Summary: [4.8 Regression] Bogus warning "Pointer might outlive

                    the pointer target"

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Keywords: diagnostic

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: ja...@gcc.gnu.org





Consider the following test case:



subroutine test

  integer, pointer :: p

  integer, target :: t

  p => t

contains

  subroutine sub()

    if (p /= 0) return

  end subroutine

end subroutine





Compiling with gfortran trunk using -Wall yields:



  p => t

  1

Warning: Pointer at (1) in pointer assignment might outlive the pointer target





I don't see how the pointer can outlive the target here (since both have the

same scope). gfortran 4.7 does not throw this warning.

Reply via email to