Re: save attribute for module variables
- From: Brooks Moses <bmoses-nospam@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 23:48:30 -0800
Jugoslav Dujic wrote:
I find your reasoning logical and an "obvious thing to do", but that's not how I parse:
"instead requiring a module variable of a user-defined type with default initialization to be given the SAVE atribute, either directly via an explicit initialization."
I interpret the last part of the sentence as "it is programmer's duty to attach the SAVE attribute (one way or another)" rather than "the save-semantics is imposed automatically by the compiler". But let's wait for James.
Your interpretation is correct: It is the programmer's duty. But you're missing the followup point, which wasn't directly stated in that quote.
If the programmer fails in this duty by omitting the SAVE, then the result becomes undefined behavior, and the compiler can do what it wants, which generally tends to be "pretend that the programmer had included the SAVE" because that's by far the easiest thing to do.
If the SAVE were not required, then the behavior with an omitted SAVE would not be undefined -- and, in particular, it would be defined as something that would be annoying to include in the compiler.
Does that clarify the interpretion any?
- Brooks
-- The "bmoses-nospam" address is valid; no unmunging needed. .
- Follow-Ups:
- Re: save attribute for module variables
- From: James Van Buskirk
- Re: save attribute for module variables
- From: Jugoslav Dujic
- Re: save attribute for module variables
- References:
- save attribute for module variables
- From: inidos
- Re: save attribute for module variables
- From: Richard Maine
- Re: save attribute for module variables
- From: James Van Buskirk
- Re: save attribute for module variables
- From: Jugoslav Dujic
- Re: save attribute for module variables
- From: Jan Vorbrüggen
- Re: save attribute for module variables
- From: Jugoslav Dujic
- save attribute for module variables
- Prev by Date: Re: Are generic linked lists possible in Fortran95?
- Next by Date: Re: save attribute for module variables
- Previous by thread: Re: save attribute for module variables
- Next by thread: Re: save attribute for module variables
- Index(es):
Relevant Pages
|
|