RFC builtin functions allocate their results

Victor Leikehman lei@haifasphere.co.il
Mon Jul 26 12:10:00 GMT 2004


> The bounds and base are inconsistent. Either use zero-based bounds, or set 
> base properly. Other temporary arrays use zero based bounds.

Oops, you are right.  But I don't think I have a choice with regard to the
bounds.  If we want the code like
	LBOUND(CSHIFT(A,B))
to work, I think we _must_ generate a 1-based result.  Correct me if I'm wrong.

Another question: I noticed in code of size0 that the bounds are checked to
have a positive extend.  So I guess I also need to say something like:

	len = array->dim[i].ubound - array->dim[i].lbound;
	if (len < 0)
		len = 0;
	ret->dim[i].ubound = len + 1;

What do you say?

-- 
  Victor Leikehman
  IBM Research Labs in Haifa, Israel



More information about the Fortran mailing list