Running C/C++ code analysis for a program
To run C/C++ code analysis for a program, run the Run C/C++ Code Analysis action on a makefile (.mak) in your TPF project.
Before you begin
- Ensure that your TPF Toolkit is connected to Linux® on IBM Z®.
- Optional: Configure C/C++ code
analysis preference settings.
The Run C/C++ Code Analysis option creates local copies of include files that are included directly or indirectly by project source files. The local copies are removed from your local machine when the TPF project is deleted. You can configure the maximum size of any individual include path to be copied to the local machine on the C/C++ Code Analysis preference page.
About this task
Each time you add new C/C++ source files to the TPF project, if you want to get the refreshed analysis information, you need to run the Run C/C++ Code Analysis action on the current set of project files.
Procedure
In Project Explorer, right-click the makefile (.mak),
and click Run C/C++ Code Analysis.
Results
- Progress is shown in the Console view. Wait for a completion message. After completion, C/C++ files are automatically refreshed with the analysis information, which provides code highlighting, navigation, and content assistance, and resolves static analysis error and warning markers.
- An Includes directory is created or updated in the TPF
project. The directory lists all the include paths. All the successfully added include paths are
also added on the Paths and Symbols properties page for the program. To view
the page, right-click the program, and click .Note: The include paths are listed in the alphabetical order, which is different from the order that the include paths are used to resolve include files and associated symbols. The include paths are used in the order that is specified on the Paths and Symbols properties page.
- If one or more included paths fail to be generated, the errors are displayed in the Problems view. To open the Problems view, click .
What to do next
- Open your C/C++ source files in an editor.
- You can customize markers in your C/C++ source files. For example, you can hide or show markers
or change the severity of markers:
- Click to open the Code Analysis preference page.
- In the Name column, select or clear the check boxes to enable or disable markers.
- In the Severity column, select Info, Warning, or Error for a marker.
- Click Apply and Close.
- As an alternative to the Run C/C++ Code Analysis
option, you can manually specify include paths one by one:
- Right-click a TPF project or a source file.
- Click .
If markers persist in the editor after you fix all the errors and issues, you can disable the
markers. For more information, see Disabling static analysis markers in C/C++ files.