Re: Error when compiling blocks code in Snow Leopard
Re: Error when compiling blocks code in Snow Leopard
- Subject: Re: Error when compiling blocks code in Snow Leopard
- From: Terry Lambert <email@hidden>
- Date: Thu, 3 Sep 2009 14:42:38 -0700
On Sep 3, 2009, at 1:48 PM, Greg Parker wrote:
On Sep 3, 2009, at 1:40 PM, Terry Lambert wrote:
The C++ standard limits the scope of variables declared like you
are declaring 'i' (as a for-init-statement, technically) to the for
itself, rather than extending to the end of the enclosing scope.
This is a standards related change in behaviour from traditional C+
+/g++, which, while not permitted by the standard, is how old
compilers tended to be implemented, not having an explicit
indicator for interior scope ends in their parse tree representation.
There's nothing wrong with his `for` scope here; he didn't use `i`
at all, much less use it out of scope. A block-local variable in a C+
+ method fails the same way with no loop at all:
Then perhaps my observation about the compiler option that causes this
to happen in C code as well will be helpful in identifying a root
cause in the C++ compiler?
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden