New ICE -Wall?
Paul Thomas
paulthomas2@wanadoo.fr
Tue Jan 9 01:01:00 GMT 2007
There is something horribly wrong with my ISP tonight: I have seen this
on the list but haven't had the forward yet - hence not noticing that
the patch is not attached.
> 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30408.diff
Type: text/x-patch
Size: 1069 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070109/a84292f7/attachment.bin>
More information about the Fortran
mailing list