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 

Regression in 7.2 with type initialisation in optional out

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



Joined: 04 Nov 2005
Posts: 165
Location: Darkest Devon

PostPosted: Mon Aug 24, 2015 3:27 pm    Post subject: Regression in 7.2 with type initialisation in optional out Reply with quote

FTN95 version 7.20 crashes when calling a subroutine/function with an optional, output parameter that is a type with initialiser.

In the following example:
Code:
module TestOptionalParam

  type OptionalType
    integer:: intVal  = 42     ! crash with initialisation, works if omitted
  end type OptionalType

contains

  subroutine FuncWithOptParam(optParam)
    type(OptionalType), optional, intent(out):: optParam
  end subroutine FuncWithOptParam

end module TestOptionalParam

program TestOptionalParamFunc
  use TestOptionalParam

  type(OptionalType):: param

  call FuncWithOptParam(param)   ! no not crash if param present
  call FuncWithOptParam()        ! crashes with param missing
end program TestOptionalParamFunc


The crash occurs on the second entry to the subroutine. It is caused by the combination of:
. initialisation within the type - if the initialisation is removed the call succeeds
. intent(out) - if this is removed or changed to intent(in out) all is well
. if the optional parameter is included in the call it's okay

This worked fine in 7.10.

Alan
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Aug 24, 2015 3:41 pm    Post subject: Reply with quote

Thanks for the feedback. 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: 7924
Location: Salford, UK

PostPosted: Tue May 31, 2016 6:48 am    Post subject: Reply with quote

This has now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
acw



Joined: 04 Nov 2005
Posts: 165
Location: Darkest Devon

PostPosted: Wed Jun 01, 2016 11:10 am    Post subject: Reply with quote

That's great news - any idea when this will be, I'm keep to use v8 but this bug has been preventing me.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 01, 2016 12:57 pm    Post subject: Reply with quote

It will be the version after 8.0 but I don't know when that will be released.
Probably a relatively short time given that 8.0 is a major version.
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