"C889 (R856) If a SAVE statement with an omitted saved entity list appears in a scoping unit, no other appearance of the SAVE attr-spec or SAVE statement is permitted in that scoping unit."
So a bare SAVE statement in a scoping unit does not (just) mean that any other SAVE statement or SAVE attribute in that scoping unit is redundant -- it somehow means that they are errors.
Why is that a necessary error?
It elicits a warning from GNU Fortran, an error from NAG, and silence from all other compilers.
module m
save
integer, save :: n
end module
program main
use m
print *, 'ok'
end
"C889 (R856) If a SAVE statement with an omitted saved entity list appears in a scoping unit, no other appearance of the SAVE attr-spec or SAVE statement is permitted in that scoping unit."
So a bare
SAVE
statement in a scoping unit does not (just) mean that any otherSAVE
statement orSAVE
attribute in that scoping unit is redundant -- it somehow means that they are errors.Why is that a necessary error?
It elicits a warning from GNU Fortran, an error from NAG, and silence from all other compilers.