core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_var_scope.htm
changeset 0 fb279309251b
child 1641 2b3996fc09a1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/com.nokia.carbide.cpp.compiler.doc.user/html/cpp_compiler/cpp_ctrl_var_scope.htm	Fri Apr 03 23:33:03 2009 +0100
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<meta name="LASTUPDATED" content="06/17/05 11:09:43" />
+<title>Controlling Variable Scope in for Statements</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body bgcolor="#FFFFFF">
+<h3>Controlling Variable Scope in for Statements</h3>
+<p>If you enable the Legacy for-scoping setting , the compiler generates an error when it encounters a variable scope issue that the ISO C++ standard disallows, but is allowed in the C++ language specified in <strong>The Annotated C++ Reference Manual</strong>.</p>
+<p>With this option off, the compiler allows variables defined in a for statement to have scope outside the for statement.</p>
+<div class="listing">
+  <h4>Listing 1. Example of a Local Variable Outside a for Statement</h4>
+  <p>for(int i=1; i&lt;1000; i++) { /* ... */ }<br />
+    return i; // OK in ARM, Error in Carbide.c++</p>
+</div>
+<p>This setting corresponds to the pragma <a href="../pragmas/p_arm_conform.htm">ARM_conform</a>. To check this setting, use <span class="code">__option (ARM_conform)</span>. By default, this setting is <span class="code">off</span>.</p>
+<p>See <a href="../symbols/sym_settings.htm">Checking Option Settings</a> for information on how to use this directive. <br />
+</p>
+<div id="footer">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+
+
+</body>
+</html>