[LLVMdev] MS C++ gives error C2371 on this code while (obviously)gcc compiles it fine
overminddl1 at gmail.com
Thu Oct 2 11:16:14 PDT 2008
On Thu, Oct 2, 2008 at 11:34 AM, Jay Freeman (saurik) <saurik at saurik.com>wrote:
> gcc is correct. According to the ISO specification, the for-init-statement
> is supposed to inject any variable names into the same declarative scope as
> the condition of an equivalent restructuring of the loop in the form of a
> while statement, which in turn fronts the declaration to an extra scope
> surrounds the /entire/ loop construct. VC++ seems to be scoping the
> variables as if they were /inside/ of the loop and not creating this extra
> scope. Frowny. -J
This can be changed in the project settings for a VC++ project. I think it
was called something like "Enforce for loop conformance" or so...
This is something I always change though.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev