C and C++ SoftBench User's Guide
Using SoftBench CodeAdvisor
Performing the "Check Code" Operation
Chapter 6 149
Performing the "Check Code" Operation
Perform the following steps to use SoftBench CodeAdvisor:
1. Build your project with the static option on (default). This gives the
compiler the -y option and generates a Static database.
2. Run SoftBench CodeAdvisor on your compiled program.
3. View any rule violations in the SoftBench CodeAdvisor error browser.
4. Filter out any rule violations that you want to ignore (optional).
5. Change your program to correct the errors.
Preparing Your Program with Project Build
You must build your program at least once with Static database creation
enabled and add the set of files to the project that you want to run
SoftBench CodeAdvisor on. To make sure that your project build
creates a Static database, examine the Compile Mode area on the main
tool face and verify that the "■ Static" toggle button is selected.
By default the Builder remembers information about your program
needed for code checking, including the compile options it needs to
rebuild your program after you make changes to your code.
Preparing Your Program with External Build
If you already have an existing build script/makefile and do not want to
spend the time to teach SoftBench to build it, you can create an external
build. (See SoftBench Online Help for details on setting up an external
build project.)
To compile from the command line and enable code checking for your
program, use the -y compiler option.
Now bring up SoftBench, create an external build project, and perform a
complete rebuild as you normally do. Select the project, and run Check
Code from the SoftBench main window. Alternatively, you can check code
from the command line using "softcheck" (see softcheck(1)); however, you
can access filtering and rule specific help only via the SoftBench main
window.