## Run Leavescan

Symbian OS has a standard convention for functions that may Leave. Therefore, any function that Leaves, or calls a function that Leaves (other than in a TRAP harness), must have a name ending in L. Leavescan verifies that your code satisfies this convention. LeaveScan ignores calls in trapped functions, commented out code, ( // and /* and */). It also checks for calls to LD, LC and LX functions as well as normal L functions. It also checks for User::Leave(), ELeave, and User::LeaveIfError().

To start, define where the path to the leavescan.exe program using the Leavescan preference panel.

Next, to run Leavescan:

- on a source file — right-click a .cpp source file in the C/C++ Projects or Symbian Project Navigator view and select Run Leavescan
- on all source files in the Active Build Configuration — right-click a .mmp file and select Run Leavescan on Project MMP. The source statements in the .mmp file are scanned to obtain a list of source files to be processed by leavescan.
- from the command line — scan whole directories and output to a file. For example,

> for /R %i in (*.cpp) do leavescan %i >> leavescan.out

> This will scan all cpp files in or below the current directory, placing the result in leavescan.out.

Figure 1. Invoking Run Leavescan on a single source file

##### Other references

- Carbide Menus
- Leavescan Preferences