Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

How to configure an analysis with C/C++

Table of Contents

What's different with C/C++? 

When analyzing C/C++ source files, important information needed for the analysis is specified at compilation time and Kiuwan Local Analyzer can't know about this in advance.

For example:

  • Where header files used in the source code are located.
  • Which macros are defined at compilation time.

Kiuwan Local Analyzer can automatically resolve this configuration to get a complete reliable analysis.

Inspecting build logs

Kiuwan Local Analyzer can inspect C and C++ build log files to automatically resolve headers and macros used in your source code.

Follow these steps to configure Kiuwan Local Analyzer by inspecting your build logs:

  1. Run the build tool (make, nmake, imake, MSbuild, scons, etc.) for the software to analyze and dump the build output to a log file. Make sure that build runs with clean dependencies. You may set the -n flag to make a build without executing compilation scripts and to ensure that commands are dumped. Examples:
    1. make clean && make -n > build.log
    2. nmake /N clean all > build.log --> cmd windows
    3. msbuild /nologo /t:rebuild MyProject.proj > build.log
    4. scons -Q -n > build.log

       

  2. Open the Kiuwan Local Analyzer, log in, select the application to analyze and set a source code folder.
  3. Select the language to analyze (C or C++) and click
the
  1. the Configuration
button
  1.  button.
  2. In
the
  1. the Analysis Configuration
tab
  1.  tab, select the analysis language in
the
  1. the Select block
dropdown
  1.  dropdown menu (C or C++).
  2. Click on
the
  1. the Details
button
  1.  button in
the
  1. the Analyze build logfile
row
  1.  row.
  2. Browse the generated build log file and
click
  1. click Analyze.

The selected build log file will be analyzed to resolve used headers and macro definitions. Once the build log file analysis is done, a results window will be shown:

Image Modified

Follow these steps to apply the found information to your configuration:

  • Click
on
  • on OK
to
  •  to update the header and macro configuration with the found data.
  • You can check that the "Header directories" and the defined macros will have been updated with the new information.
  • Click on Save" button to apply the configuration to your application (or globally).

You can also click on "Cancel" button if you want to analyze again a log file, change the log file or not apply the found information to the current configuration. Note that the configuration will not be saved until you click on "Save" button in the main configuration dialog.

Now you can click on "Analyze" to analyze your C or C++ application with the new header and macro definitions.