2
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>
|
|
2 |
<title>Optimizing CodeScanner</title>
|
|
3 |
<link rel="StyleSheet" href="../book.css" type="text/css"/>
|
|
4 |
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
|
|
5 |
</head>
|
|
6 |
<body>
|
|
7 |
<div class="Head1">
|
|
8 |
<h2>Optimizing CodeScanner</h2>
|
|
9 |
</div>
|
|
10 |
<p>Below are some ways of optimizing how CodeScanner operates, including:</p>
|
|
11 |
<ul>
|
|
12 |
<li><a href="#IGNORE">Commenting out CodeScanner messages</a></li>
|
|
13 |
</ul>
|
|
14 |
<h3><a name="IGNORE" id="IGNORE"></a>Commenting out CodeScanner messages</h3>
|
|
15 |
<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>
|
|
16 |
<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>
|
|
17 |
<p class="code">codescanner(::<rule_name>)+ </p>
|
|
18 |
<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>
|
|
19 |
<p class="listing">void CTestCase::Foo() { <br />
|
|
20 |
RPtrArr *iMember = obj.Array; // codescanner::pointertoarrays::variablenames<br />
|
|
21 |
array->At(a); // codescanner::accessArrayElementWithoutCheck<br />
|
|
22 |
User::Leave(KErrNone); /* codescanner::LeaveNoError */ <br />
|
|
23 |
}</p>
|
|
24 |
<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>
|
|
25 |
<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>
|
|
26 |
</body>
|
|
27 |
</html>
|
|
28 |
|