View previous topic :: View next topic |
Author |
Message |
JohnMansell
Joined: 10 May 2006 Posts: 18 Location: Darlington
|
Posted: Mon Mar 17, 2008 11:12 am Post subject: ftn95 5.20 - ALLOCATABLE in TYPE |
|
|
Use of ALLOCATABLE in TYPE declaration is now tolerated though not standard conforming. Er, tell us some more. Is this not TR15881? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Mar 17, 2008 4:52 pm Post subject: |
|
|
FTN95 aims to conform to the 95 Fortran standard.
It has bits of Fortran 2003 but does not currently aim to conform to this standard.
If this feature is included in the 2003 standard then all well and good.
It means that others have thought about this and see no inconsistency. |
|
Back to top |
|
|
wws
Joined: 25 Oct 2007 Posts: 7 Location: California
|
Posted: Fri Apr 25, 2008 9:47 pm Post subject: Re: |
|
|
PaulLaidler wrote: | FTN95 aims to conform to the 95 Fortran standard.
It has bits of Fortran 2003 but does not currently aim to conform to this standard.
If this feature is included in the 2003 standard then all well and good.
It means that others have thought about this and see no inconsistency. |
Paul: Allowing ALLOCATABLE in derived types is a F2003 feature, and was also described in the TR 15581 as an addendum to F95. This is a highly desirable feature, and would be great if you supported the entire TR. (The TR also adds ALLOCATABLE dummy args, ALLOCATABLE function results, and a couple of other related things.)
Note that ALLOCATABLE differs from POINTER because the compiler should arrange for automatic deallocation of memory when an ALLOCATABLE object goes out of scope. This guarantees there will be no memory leakage. With pointers, the onus is on the user to avoid memory leakage. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Sat Apr 26, 2008 7:53 am Post subject: |
|
|
I have already implemented this recommendation although it looks like I forgot to report this in the orginal thread in the forum.
I will check out the automatic deallocation issue - thank you. |
|
Back to top |
|
|
|