(j3.2006) SAVE and MAXLOC - Fortran 95 <-> 2003 incompatibility?
Robert Corbett
robert.corbett
Thu Sep 20 04:53:55 EDT 2012
On 09/20/12 01:50, Tobias Burnus wrote:
> Hi all,
>
> I have a question: Does the variable "x" have the SAVE attribute or not
> in the following program. (Or ask reversely, is "x" an automatic
> variable or not?)
>
> Depending on the compiler, I get the result "1" or "2". In Fortran 95,
> MINVAL is not an initialization expression, in Fortran 2003/2008 it is.
>
> And all standards state (e.g. F2008, 5.4.14 SAVE statement, para. 1,
> page 108):
>
> "[...] A SAVE statement without a saved entity list is treated as though
> it contained the names of all allowed items in the same scoping unit."
>
> Is this just an incompatibility between Fortran 95 and Fortran
> 2003/2008? Or have I missed something, e.g. an interpretation request.
This is a known issue. It is covered in the final bullet items in
Clauses 1.6.3 and 1.6.4.
Robert Corbett
More information about the J3
mailing list