forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ubound, lbound on zero size array sections

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Apr 04, 2013 10:11 am    Post subject: Ubound, lbound on zero size array sections Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Apr 04, 2013 5:08 pm    Post subject: Reply with quote

I have logged this for investigation.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Mar 12, 2014 2:13 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Wed Mar 19, 2014 8:25 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Mar 27, 2014 2:33 pm    Post subject: Reply with quote

This bug has now been fixed for .NET and also for ranks other than one.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group