This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, fortran] Simplify constant substrings


On Friday 22 July 2005 16:15, Paul Brook wrote:
> > > ! 	  s = gfc_getmem (end - start + 1);
>
> Should be +2 if you're including the null terminator.

The original had:

!         gfc_extract_int (p->ref->u.ss.start, &start);
!         start--;  /* Convert from one-based to zero-based.  */
!         gfc_extract_int (p->ref->u.ss.end, &end);
!         s = gfc_getmem (end - start);

;-)

Gr.
Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]