Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Integrating Klocwork with Wind River Workbench

Integrating Klocwork with Wind River Workbench

If you are using the Klocwork tools integrated with Wind River Workbench, the process is automatic for projects created in Wind River. The steps below are for projects that were created outside of the Wind River environment.

Configuring simple projects

These instructions are for individual, unstructured projects. If you are using a hierarchical subproject/superproject structure, see configuring structured projects.

Rebuild and refresh the project. To do an incremental build, right-click your project and select Build Project. To do a full build, right-click your project and select Rebuild Project. In order to get the full build specification, you'll need to do a full build.

You need to rebuild once to create the initial build specification in the project directory. After that, the only time you should need to rebuild again is when new files are added.
Note: Before you run analysis, you need to specify your license settings.

Specify your build settings

  1. In the Project Properties, select Klocwork Build Settings.
  2. Select Use build specification file, browse to the build specification you created, and click OK.

The properties are saved for the selected project and used when you run your next analysis. You only have to specify build settings once for your project, as long as your updated build specification file remains in the same location.

Connect to a project on the Klocwork Server

You get the most from static code analysis when you connect a small local project to a larger project on the Klocwork Server. The small local project is analyzed quickly while incorporating Klocwork knowledge bases generated on the server where additional source files were analyzed (for example, shared libraries). Connecting to a server project also allows you to share issue status information with the integration build analysis and among team members. You can run a standalone desktop analysis, but the analysis only derives knowledge from the local project's source files.

You perform this step only once for each project.

  1. In the project properties view navigator, expand Klocwork and select Enable project specific settings.
  2. Click the Synchronization tab.
  3. Ensure that the Klocwork Server host and port information is correct.
  4. In the Project name list, select the server project you want to connect to.
  5. Enable the Use secure connection checkbox if a secure connection to the Klocwork Server has been set up.
  6. Click OK.
    When you set up your connection, synchronization occurs between the integration project and your desktop project, pulling configuration information from the integration project.
    You only have to do this step once for each project.

Configuring structured projects

These instructions are for structured projects. If you are using an unstructured projects, see configuring unstructured projects.

When you have a subproject/superproject structure in Wind River Workbench, the build settings you generate and specify for the superproject are applied to subprojects during the desktop analysis.

Additionally, in a structured project hierarchy, Klocwork configuration settings, such as enabled or disabled checkers, are pulled from the Klocwork Server project that is connected to the superproject and applied to all projects in your hierarchy.

Specify your build settings for your superproject

Rebuild and refresh your superproject. Klocwork will collect build information for all projects and analyze files from both the superproject and all subprojects. In order to view the defects, you need to select the superproject.

The properties are saved for the selected project and used when you run your next analysis. You only have to specify build settings once for your project, as long as your updated build specification file remains in the same location.

These build settings are applied to the superproject and all subprojects in your structure each time the desktop analysis runs. You can have a specific build specification for subprojects by specifying a build specification file, but all UI settings are still taken from the top project preferences page.

Note: Before you run analysis, you need to specify your license settings.

If you need to start multiple builds, you can right-click your project and select Build options > Build Enabled Build Specs. If analysis is run while the native build is running, it will use the configuration from the last analysis.

Viewing detected issues in project structures and shared subprojects

You may notice different issues in the list for the same file when referenced superprojects have different checkers enabled or disabled.

For example, if the same library is referenced from two different superprojects, the defects that display in the Klocwork Issues view (or in the editor) for the library files depend on the settings from the last selected superproject.

Next step: Connect to a project on the Klocwork Server.

Important: You only connect your superproject to the project on the Klocwork Server.

Troubleshooting

The build instrumentation does not work out-of-the box for the following project types:

  • VxWorks Boot Loader/BSP Project
  • VxWorks Image Project
  • VxWorks Source Build (Kernel Library Project)

These projects are using the "make" command by default, while other Wind River projects are using "%makeprefix% make". The build instrumentation relies on "%makeprefix%.

The workaround is to add "%makeprefix%" manually:

  • Boot Loader and VxWorks Image projects:
    The build command line is not visible in project properties. To add "%makeprefix%" manually:
    1. Open the <project>/.wrproject file in a text editor
    2. Find the following property: <stringAttribute key="BLD::Info|cmd" value="make"...>, and replace "make..." with "%makeprefix% make..."
    3. Save the file, then rebuild the project.
  • VxWorks Source Build (Kernel Library Project):
    1. Open project properties and go toBuild Properties
    2. Replace "make..." with "%makeprefix% make..."
    3. Rebuild the project