View previous topic :: View next topic |
Author |
Message |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Apr 04, 2013 10:11 am Post subject: Ubound, lbound on zero size array sections |
|
|
Should the call to UBOUND return a value smaller than the call to LBOUND in this code?
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. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Apr 04, 2013 5:08 pm Post subject: |
|
|
I have logged this for investigation. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Mar 12, 2014 2:13 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Mar 19, 2014 8:25 am Post subject: |
|
|
Thanks Paul.
I can see you have made some good progress in fixing a few issues. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Mar 27, 2014 2:33 pm Post subject: |
|
|
This bug has now been fixed for .NET and also for ranks other than one. |
|
Back to top |
|
|
|