[PATCH] PR fortran/85521 -- Zero length substrings in array aconstructors

Andre Vehreschild vehre@gmx.de
Sun May 13 12:32:00 GMT 2018


Hi,

sorry, I didn't get, that this is standard conforming. So go for it: Ok for
trunk and thanks for the patch.

- Andre

On Thu, 10 May 2018 08:41:21 -0700
Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:

> It is certainly possible to give a warning, but it
> would be odd (to me) to warn about technically
> standard conforming code.  gfortran doesn't warn
> for zero-sized array references or zero-length
> substrings in other context.
> 
> program foo
>    real a(4)
>    character(len=10) s
>    s = '12345'
>    a = 1
>    print *, size(a(2:1)), len(s(3:2))
> end program foo
> % gfc -o z a.f90
> % ./z
>            0           0
> 


-- 
Andre Vehreschild * Email: vehre ad gmx dot de 



More information about the Gcc-patches mailing list