This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative
- From: FX <fxcoudert at gmail dot com>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Oct 2015 23:39:51 +0200
- Subject: Re: [PATCH] PR fortran/67987 -- character lengths cannot be negative
- Authentication-results: sourceware.org; auth=none
- References: <20151016190831 dot GA81904 at troutmask dot apl dot washington dot edu> <E0AD3803-1E0A-410F-BA35-FA8B367716F5 at gmail dot com> <20151016212657 dot GA22421 at troutmask dot apl dot washington dot edu>
> 2015-10-16 Steven G. Kargl <kargl@gcc.gnu.org>
>
> 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', then length of string is negative,
> so explicitly set it to zero.
> (resolve_charlen): Remove -Wsurprising warning. Update comment to
> text from F2008 standard.
>
> 2015-10-16 Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR fortran/67987
> * gfortran.dg/char_length_2.f90: Add declaration from PR to testcase.
The patch is now mostly OK to me. Minor remarks:
- Iâm thinking you mean âforce it to zero per [not pre] Fortran standardsâ
- why remove the -Wsurprising warning? it seems a good case for -Wsurprising: legal code, but dubious anyway
OK after you ponder that second point.
FX