Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-17 Thread FX
> F90 is over 26 years old. There has been 3 major revisions that > have superceded F90 (F95, F03, and F08). All of those revisions > include the text that you pointed out to me. Why is it surprising > that a compiler conforms to the standard? > > "Simplify, simplify, simplify." Henry David

Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-16 Thread Steve Kargl
On Fri, Oct 16, 2015 at 02:55:27PM -0700, Steve Kargl wrote: > On Fri, Oct 16, 2015 at 11:39:51PM +0200, FX wrote: > > > - why remove the -Wsurprising warning? it seems a good case > > for -Wsurprising: legal code, but dubious anyway > > > > OK after you ponder that second point. > > > > F90

Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-16 Thread Steve Kargl
On Fri, Oct 16, 2015 at 11:39:51PM +0200, FX wrote: > > 2015-10-16 Steven G. Kargl > > > > PR fortran/67987 > > * decl.c (char_len_param_value): Unwrap unlong line. If LEN < 0, > > then force it to zero pre Fortran Standards. > > * resolve.c (gfc_resolve_substring_charlen): Un

Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-16 Thread FX
> 2015-10-16 Steven G. Kargl > > PR fortran/67987 > * decl.c (char_len_param_value): Unwrap unlong line. If LEN < 0, > then force it to zero pre Fortran Standards. > * resolve.c (gfc_resolve_substring_charlen): Unwrap unlong line. > If 'start' is larger than 'end

Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-16 Thread Steve Kargl
On Fri, Oct 16, 2015 at 10:17:34PM +0200, FX wrote: > > The attach patch enforces the Fortran Standard's requirement > > that character length must be great than or equal to zero. > > 4.4.3.2. "If the character length parameter value evaluates to > a negative value, the length of character entitie

Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative

2015-10-16 Thread FX
> The attach patch enforces the Fortran Standard's requirement > that character length must be great than or equal to zero. We've got to be careful about this. The standard (F2008) has this to say about character lengths: 4.4.3.1. "The number of characters in the string is called the length of t