[patch, gfortran] PRs 15975 & 16606

Paul Thomas paulthomas2@wanadoo.fr
Sat Sep 17 12:40:00 GMT 2005


Erik,

:REVIEWMAIL:

>
>2005-09-16 Erik Edelmann <erik.edelmann@iki.fi>
>
>        PR fortran/15975
>        PR fortran/16606
>        * resolve.c (resolve_symbol): Don't assign default
>          initializer to pointers.
>
Just as I got told off for claiming separate fixes for repeat PRs, so 
should you........! Just the PR15795, please, Erik.

> ! { dg-do compile }
>
>! PR 15975, PR 16606
>! Pointers to derived types with initialized components
>SUBROUTINE N
>  TYPE T
>    INTEGER :: I = 0
>  END TYPE T
>  TYPE(T), POINTER :: P
>END SUBROUTINE N
>
I have this slight nervousness about tests that merely check that 
something compiles.  Is it not better to check the functionality with 
the likes of the test below?

! { dg-do run }
! PR 15975, PR 16606
! Pointers to derived types with initialized components
SUBROUTINE N
  TYPE T
    INTEGER :: I = 99
  END TYPE T
  TYPE(T), POINTER :: P
  TYPE(T), TARGET  :: Q
  P => Q
  if (P%I.ne.99) call abort ()
END SUBROUTINE N

program test_pr15975
  call n ()
end program test_pr15975


Apart from these two remarks, this is OK - it even does what is claimed 
for it.

Do you not have cvs commit permission?  I'll do the honours for you 
tomorrow night, if not.  It will have to be mainline for now.  Could you 
remind me, when 4.03 is open, please?

Paul T





More information about the Gcc-patches mailing list