Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Some ABIs require that the stack pointer is only decremented once per function invocation to assist exception unwinding code. Commented Sep 2, 2013 at 14:43
  • Good point. But those are implementation specifics. For matters like these, one would go by the semantics of the language, don't you think? Commented Sep 2, 2013 at 17:56
  • Well, you can't answer a question that has implementation-defined behaviour by talking about what the standard says. Commented Sep 2, 2013 at 18:03
  • Why not? In many cases, what matters is what you should count on i.e. what the language promises. Because that is the least common denominator. In this case, what you should count on is the assumption that the lifetime of the variable is the lifetime of the block scope, as it is guaranteed to be at least that in all implementations of the language. Commented Sep 2, 2013 at 18:16
  • And none of that has anything to do with the implementation detail the OP is asking about - namely when/if the allocation happens and how big it will be. When it comes to semantics, you're absolutely right. Commented Sep 2, 2013 at 18:22