This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libfortran] Fix PR 18958
- From: Thomas Koenig <Thomas dot Koenig at online dot de>
- To: Thomas Koenig <Thomas dot Koenig at online dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 29 Apr 2005 21:54:32 +0200
- Subject: Re: [patch, libfortran] Fix PR 18958
- References: <20050410222101.GA28958@meiner.onlinehome.de>
On Mon, Apr 11, 2005 at 12:21:01AM +0200, I wrote:
> This one-letter patch fixes PR 18958. It changes index_type from
> size_t to ssize_t, making it signed.
Is this OK now, following the discussion on PR 18857?
Thomas
> 2005-04-11 Thomas Koenig <Thomas.Koenig@online.de>
>
> PR libfortran/18958
> libgfortran.h: Change typedef of index_type from size_t
> to ssize_t.
>
> 2005-04-11 Thomas Koenig <Thomas.Koenig@online.de>
>
> PR libfortran/18958
> * eoshift.f90: New test case.
>
> Index: libgfortran.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libgfortran/libgfortran.h,v
> retrieving revision 1.23
> diff -c -r1.23 libgfortran.h
> *** libgfortran.h 1 Feb 2005 09:06:22 -0000 1.23
> --- libgfortran.h 10 Apr 2005 22:09:56 -0000
> ***************
> *** 215,221 ****
> /* The following two definitions must be consistent with the types used
> by the compiler. */
> /* The type used of array indices, amongst other things. */
> ! typedef size_t index_type;
> /* The type used for the lengths of character variables. */
> typedef GFC_INTEGER_4 gfc_charlen_type;
>
> --- 215,221 ----
> /* The following two definitions must be consistent with the types used
> by the compiler. */
> /* The type used of array indices, amongst other things. */
> ! typedef ssize_t index_type;
> /* The type used for the lengths of character variables. */
> typedef GFC_INTEGER_4 gfc_charlen_type;
>
> ! { dg-do run }
> ! PR 18958: We used to segfault for eoshifting off the end of an array.
> program main
> character(len=20) line
> write (line,'(I4)') eoshift((/1, 3/), 3)
> end program main