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

2018-05-13 Thread Andre Vehreschild
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 wrote: > It is certainly possible to give a warning, but it > would be odd (to me) to warn

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

2018-05-10 Thread Steve Kargl
On Thu, May 10, 2018 at 07:56:59PM +0200, Thomas Koenig wrote: > Am 10.05.2018 um 17:41 schrieb Steve Kargl: > > It is certainly possible to give a warning, but it > > would be odd (to me) to warn about technically > > standard conforming code. > > Maybe we could add > > gfc_warning (0,

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

2018-05-10 Thread Thomas Koenig
Am 10.05.2018 um 17:41 schrieb Steve Kargl: It is certainly possible to give a warning, but it would be odd (to me) to warn about technically standard conforming code. Maybe we could add gfc_warning (0, "Standard-conforming code found, your code may run as expected"); at the end of the

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

2018-05-10 Thread Steve Kargl
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

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

2018-05-10 Thread Andre Vehreschild
Hi Steve, the patch looks OK to me. Is it possible to give a warning there, at least with some higher warning-level? Or is there already one? I haven't tested it. Regards, Andre On Thu, 10 May 2018 07:15:21 -0700 Steve Kargl wrote: > On Thu, May 10,

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

2018-05-10 Thread Steve Kargl
On Thu, May 10, 2018 at 11:48:24AM +0200, Dominique d'Humières wrote: > Hi Steve, > > AFAICT the patch is missing. > > Thanks for working on these PRs. > Whoops. Looks like attached the log instead of diff. Index: gcc/fortran/array.c

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

2018-05-10 Thread Dominique d'Humières
Hi Steve, AFAICT the patch is missing. Thanks for working on these PRs. Dominique

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

2018-05-09 Thread Steve Kargl
I paln to commit the attached patch on Saturday unless someone objects. 2018-05-09 Steven G. Kargl PR fortran/85521 * array.c (gfc_resolve_character_array_constructor): Substrings with upper bound smaller than lower bound are zero length strings.