srcanaapps/codescannerextn/com.nokia.carbide.cpp.codescanner/html/optimizing_cs.htm
Licenses updated to EPL.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>
<title>Optimizing CodeScanner</title>
<link rel="StyleSheet" href="../book.css" type="text/css"/>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
</head>
<body>
<div class="Head1">
<h2>Optimizing CodeScanner</h2>
</div>
<p>Below are some ways of optimizing how CodeScanner operates, including:</p>
<ul>
<li><a href="#IGNORE">Commenting out CodeScanner messages</a></li>
</ul>
<h3><a name="IGNORE" id="IGNORE"></a>Commenting out CodeScanner messages</h3>
<p>It's possible to tell CodeScanner to ignore specific error or warning messages by inserting specifically formatted comments into source code. This is useful for example, when you have a source line that generates error messages that you know are false and would like to suppress for that single line of code without disabling it elsewhere in the project.</p>
<p>All CodeScanner rules are applicable when commenting out any line of code. The rule names that can be used are listed in the <img src="images/command_link.png" width="16" height="12" border="0" alt="" /> <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=com.nokia.carbide.cpp.codescanner.ui.CSPreferencePage)")'> CodeScanner</a> <a href="pref_codescanner_03.htm">Rules</a> page in the <b>Preferences</b> window. The command to implement a rule suppression looks like this:</p>
<p class="code">codescanner(::<rule_name>)+ </p>
<p>And rules to suppress must appear after the C/C++ comment style of "<span class="code">//</span>" or enclosed in "<span class="code">/*</span>" and "<span class="code">*/</span>". For example:</p>
<p class="listing">void CTestCase::Foo() { <br />
RPtrArr *iMember = obj.Array; // codescanner::pointertoarrays::variablenames<br />
array->At(a); // codescanner::accessArrayElementWithoutCheck<br />
User::Leave(KErrNone); /* codescanner::LeaveNoError */ <br />
}</p>
<p>Note that multiple rules can be applied to a single line (e.g. <span class="code">RPtrArr</span> as shown above) when prefixed by "<span class="code">::</span>". All rules only apply to the line they are matched with and rules must be contained within that single line.</p>
<div id="footer">Copyright © 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>