New ICE -Wall?
Paul Thomas
paulthomas2@wanadoo.fr
Mon Jan 8 21:09:00 GMT 2007
This is embarrassing - I forgot about derived type components *sigh*
Since the code->expr has been resolved, the expr character length is as
available as it ever will be, if it is constant. Thus the patch uses
that, rather than the symbol's.
I notice that substring references could be resolved but are not - see
below.
I can do something about this at the weekend - if anybody wants to get
this out of the door now, please do. Note that it is not regtested.
Paul
module linebufmod
implicit none
type linebuf
character(len=80), dimension(:), pointer :: data=>NULL()
end type linebuf
type linebuf_short
character(len=2), dimension(:), pointer :: data=>NULL()
end type linebuf_short
contains
subroutine linebuf_add (buf, buf_short)
type(linebuf), intent(inout) :: buf
type(linebuf_short), intent(inout) :: buf_short
character(4) :: chr
buf%data(1) = "blah"
buf%data(1)(1:2) = "blah" ! misses this
buf_short%data(1) = "blah" ! { dg-warning "will be truncated" }
chr(1:2) = "blahblah" ! misses this too
end subroutine linebuf_add
end module linebufmod
More information about the Fortran
mailing list