Silverfrost Forums

Welcome to our forums

Ubound, lbound on zero size array sections

4 Apr 2013 9:11 #11966

Should the call to UBOUND return a value smaller than the call to LBOUND in this code?

program main

   real :: a(3)

   a = 0.0

   print *, 'size of a(2:1) is ', size(a(2:1))          !< Should be 0 (works OK)
   print *, 'Lower bound of a(2:1) is ', lbound(a(2:1)) !< Should be 1 (works OK)
   print *, 'Upper bound of a(2:1) is ', ubound(a(2:1)) !< Should be 0 (but 1 obtained)

end

The SIZE and LBOUND are correct I think. If you implement UBOUND as LBOUND + SIZE - 1 it should always work.

4 Apr 2013 4:08 #11974

I have logged this for investigation.

12 Mar 2014 1:13 #13829

This bug has been fixed for the next release but only for Win32 (not yet for .NET). If anyone is waiting for a fix for .NET then please let me know.

19 Mar 2014 7:25 #13870

Thanks Paul.

I can see you have made some good progress in fixing a few issues.

27 Mar 2014 1:33 #13894

This bug has now been fixed for .NET and also for ranks other than one.

Please login to reply.