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 

Missing block name not diagnosed

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



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Fri Aug 28, 2020 3:23 pm    Post subject: Missing block name not diagnosed Reply with quote

Fortran 95 has the following constraint in section 8.1.4.1.1 :

Quote:
Constraint: If the do-stmt is a label-do-stmt, the corresponding end-do shall be identified with the same label.


The example source code below is in violation of this rule, yet FTN95 does not catch the syntax error.

Code:
      subroutine tst(vel,n)
      implicit none
      integer, intent(in) :: n
      real, intent(in) :: vel(n,n)
      integer :: nfound, x, y, i, j
      real u(2)
     
      nfound = 0
      x = 7; y = 5
  dw: do while (nfound < 10)
         call random_number(u)
         u = 5*u + 2.5
         do i = 1,n
            do j = 1,n
               if (vel(j,i) > 25.3 .and. (u(1) > x .or. u(2) < y)) cycle dw
            end do
         end do
      end do ! dw  (this label name is required)
      print *, 'Ten qualified entries found'
      return
      end subroutine


Gfortran gives the message

Quote:
Error: Expected block name of 'dw' in END DO statement at (1)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Aug 28, 2020 4:36 pm    Post subject: Reply with quote

mecej4

Thank you for the bug report. I have made a note of this.
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: Mon Aug 31, 2020 8:56 am    Post subject: Reply with quote

This has now been fixed for the next release of FTN95. It was failing for DO WHILE and FORALL.
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