Symbian OS
read last symbian news on www.newlc.com read last symbian reviews on www.newlc.com
read last symbian tutorial on www.newlc.com read last symbian download on www.newlc.com
13 Dec 2006 - 22:04

LeaveScan is a command-line utility developped by Symbian Ltd that checks that your code respects the naming conventions for leaving functions.

This article will show you how to integrate it and use it directly from Nokia Codewarrior (version 3.x is required).

1. Download LeaveScan

The utility is available for download on Symbian web site. Download the LeaveScan.exe file and install it in:

C:\Program Files\Symbian OS Tools\LeaveScan

The same technique can be used to integrate the SymScan which detect a few more issues but is more verbose.

2. Create a tool entry in Codewarrior

Go to the installation directory of your Codewarrior IDE and locate the Nokia x86 Compiler.cwcomp file and make a copy of it called LeaveScan.cwcomp.

If you are using Codewarrior 3.1 and installed it in its default location, the file should be in:

C:\Program Files\Nokia\CodeWarrior for Symbian v3.1\Bin\Plugins\Support\CompilerDescriptors\Symbian\

Open the new file "LeaveScan.cwcomp" in a text editor and make the following changes:

Find the following text in the file (around line 88):

...
<!-- End of Compiler Definition -->
<struct>
...

Right after the "End of Compiler Definition" comment, add the following text:

<struct>
<!-- +++++++++++++++Leave Scan++++++++++++++ -->
<setting uuid-alias="." entry="toolSymbolicCommandDef">
<simple>${var:TOOL_NAME} "${source.name}"</simple>
</setting>
<setting uuid-alias="." entry="toolType">
<simple>kToolLeaveScan</simple>
</setting>
<setting uuid-alias="." entry="toolDisplayName">
<simple>Symbian Leave Scan tool</simple>
</setting>
<setting uuid-alias="." entry="toolExecutableName">
<simple>C:\Program Files\Symbian OS Tools\LeaveScan\leavescan.exe</simple>
</setting>
<setting uuid-alias="." entry="parseStdOut">
<simple>true</simple>
</setting>
<setting uuid-alias="." entry="parseStdErr">
<simple>false</simple>
</setting>
<setting uuid-alias="." entry="defaultSwitch">
<simple></simple>
</setting>
<setting uuid-alias="." entry="outputParser">
<simple>kGCCMessageFormatParser</simple>
</setting>
</struct>

This adds a tool call defintion that can be executed during compilation.

3. Setup the new tool

In the same file, find the following text (line 51):

<setting uuid-alias="." entry="postActionIdentifiers">
<array inheritance="none">
<simple>kToolSize</simple>
</array>
</setting>

and add a line after the kTookSize call:

<simple>kToolLeaveScan</simple> :

The new block shall now look like:

<setting uuid-alias="." entry="postActionIdentifiers">
<array inheritance="none">
<simple>kToolSize</simple>
<simple>kToolLeaveScan</simple>
</array>
</setting>

This makes a call to the leavescan utility after a successful call to the compiler and size tool.

Now you can save the file and choose the tool you just created.

4. Set up your project target

Open up a project's WINSCW target settings and navigate to the Code Generation | Symbian Compiler preference, change the compiler option from Nokia x86 Compiler to LeaveScan:

LeaveScan.png

A warning message will now be emitted each time a leaving function does not have a trailing L in its name:

LeaveScan2.png

5. Enjoy...

... or fix your code. (and now you have no excuses for mis-naming your functions!

Nokia_x86_LeaveScan.zip
Nokia_x86_LeaveScan.zip

This article is an update of Tim's post on Forum Nokia
Tutorial posted December 13th, 2006 by eric

Submitted by vin2ktalks (not verified) on Fri, 2006-12-15 06:12.

Hi Eric,

I've a custom created setup for SymScan for CW 3.0. You've to keep my zip file in the :\Program Files\Nokia\CodeWarrior for Symbian v3.1\Thrill_Seekers\ folder and extract that and then run install_symscan_cwide.cmd, that's it. If you can upload it in to the article then I can mail you.

vin2ktalks


Submitted by Badshah (not verified) on Fri, 2007-03-09 11:43.

Hi Eric, I tried to integrate the leave scan utility to my codewarrior 3.1. When i build an application, it compiles and links fine and then it shows an error message "Error starting external process. Process error code 193(0xc1)" and then " Operating system error -600. No eligible process with specified process serial number" message. The emulator is not getting displayed. What will be the problem?? thanks for you help


copyright 2003-2009 NewLC SARL