If you are making a tweet, a question I had about allocate is does the standard require a failed allocate to make no change to the variables listed, or is the state undefined? That is, after this failed ALLOCATE() do I know anything about the state ofthe variable per the standard?
On 3/24/2022 12:06 AM, John wrote:of the variable per the standard?
If you are making a tweet, a question I had about allocate is does the standard require a failed allocate to make no change to the variables listed, or is the state undefined? That is, after this failed ALLOCATE() do I know anything about the state
Allocatable variables do not have an undefined state - it is either allocated or unallocated (9.7.1.3).
If an ALLOCATE fails, the allocation status is unchanged. This applies
to both allocatable and pointer variables (pointers can have an
undefined state.)
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org
I planned on reporting that but wanted to make sure the compiler was not free to change the state and value on failure of an allocate.
On 3/24/2022 7:53 PM, John wrote:
I planned on reporting that but wanted to make sure the compiler was not free to change the state and value on failure of an allocate.It is not. Report the bug.
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 99:33:22 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,786 |