This documentation is not maintained. Please refer to doc.castsoftware.com/technologies to find the latest updates.

Summary: This section describes the predefined Environment Profiles supplied with the extension and the custom Environment Profiles that can be created where required.

Environment Profiles can only be managed by the legacy CAST Management Studio (no interface available in AIP Console to do this).

Introduction

Environment Profiles are a set of predefined (by CAST) or custom configuration settings that can be included in an analysis:

Predefined Environment Profiles

Predefined Environment Profiles are applied to analyses automatically by the extension, depending on the technology options you choose, whether at default level or at Application or Analysis Unit level. CAST provides several predefined Environment Profiles in the C/C++ extension tailor the analysis configuration settings to the specific IDE used to build the C/C++ application, in particular setting dedicated Include Paths and adding specific Macros:

Custom Environment Profiles

A custom Environment Profile can be particularly useful where you have several Analysis Units (for example a large project that has been split) that rely on the same specific settings. By creating a custom Environment Profile that defines these settings, you avoid having to configure each Analysis Unit with the same settings - instead you simply include the custom Environment Profile at  Application or Analysis Unit level using the Custom Environment Profile option. When the analysis is run, the settings in the Environment Profile are taken into account.

For the C/C++ Analyzer extension, it is possible to create Environment Profiles to set custom Include Paths and add in custom Macros required by your application.

Note that you can apply multiple custom C/C++ Environment Profiles to an analysis.

Managing custom Environment Profiles

If you want to create new custom Environment Profiles, you need to use the Environment Profile Manager. This can be accessed from the Analysis tab in the Application or Analysis Unit:

The Profile Manager will then launch:

  • The left hand section displays a collapsible list of any Predefined or existing Custom Environment Profiles listed by technology, then by profile name. If this the first time you have used the Environment Profile dialog box, then this section will only contain the predefined profiles - they will be grayed out. If you have already created profiles then you can expand the list and select the profile you want to modify or delete.
  • The right hand section provides the means to define new profiles and get access to existing profiles for modification and deletion purposes.

Creating a custom profile

Select the C++ Environment Profile entry in the left hand panel, then click the  icon in the right hand panel:

A new screen will be displayed containing various tabs:

  • General > For defining a name for the Environment Profile and for defining Include Paths
  • Macros > For defining custom macros used in your source code - these will be used by the internal pre-processor when the associated job is run.

General tab


  • Enter a name for the Environment Profile. Choose a name that is easily recognizable as this name will be displayed in the left hand collapsible list and will be used when you add the Environment Profile at Application or Analysis Unit level.
  • Then use the  icon to add in any custom Include Paths

Macros tab

The Macros tab enables you to configure macros that will be used by the internal pre-processor when the associated job is run.

  • Click the  icon to create a new custom macro entry and fill in the Name and Value items.
  • Force included file - this section enables you to specify macros in file format by specifying a specific file. This file will contain the macros that you want the analyzer to take into account and must have the same structure as any .c, .cpp or .h file (in other words, this file can contain "#define" orders to define macros, "#include" orders to include files, but also declare functions). It is possible to enter a simple filename (for example test.h) without an absolute path. In this case, when the analysis is run, the analyzer will search for the file in the current folder and then in the include folders (defined in the Includes option (see C and Cpp - Analysis configuration) or in the Environment Profile).

Enabling custom Environment Profiles

Use the following options in the Analysis tab at Application/Analysis Unit level to select a custom Environment Profile you have created (click to enlarge):