[PATCH] PR fortran/77505 -- Treat negative character length as LEN=0
Steve Kargl
sgk@troutmask.apl.washington.edu
Thu Dec 1 23:23:00 GMT 2016
On Wed, Nov 30, 2016 at 05:13:28AM +0000, Punnoose, Elizebeth wrote:
> Please excuse the messy formatting in my initial mail. Resending
> with proper formatting.
>
> This patch checks for negative character length in the array
> constructor, and treats it as LEN=0.
>
> A warning message is also printed if bounds checking is enabled.
>
> Bootstrapped and regression tested the patch on x86_64-linux-gnu
> and aarch64-linux-gnu.
>
Thanks. After regression testing on x86_64-*-freebsd, I committed
the attached patch. Not sure if the whitespace got messed up by
my email agent, but I needed to reformat your testcases. I took the
opportunity to rename and improve the testcases. The improvements
check that in fact len=0 and that a warning is issued.
Hopefully, you're inclined to submit additional patches in the future.
A few recommendations are to include the text of your ChangeLog
entry in body of the email, for example,
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505
* trans-array.c (trans_array_constructor): Treat negative character
length as LEN = 0.
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505
* gfortran.dg/char_length_20.f90: New test.
* gfortran.dg/char_length_21.f90: Ditto.
(Note, 2 spaces before and after your name.) Then attach the
patch to the email. This hopefully will prevent formatting
issues with various email clients/servers.
--
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr77505.diff
Type: text/x-diff
Size: 3066 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161201/5ede6f0d/attachment.bin>
More information about the Gcc-patches
mailing list