The C/C++/Objective-C Technology editor contains various tabs. Each is explained below.
Notes
Global settings
Analyzer to invoke | Use this option to choose between the analysis engine that will be used to run the analysis: | Legacy analyzer This option invokes the legacy C/C++ analyzer as provided in previous releases of CAST AIP. By default this option will always be active at Technology/Application/Analysis Unit level. |
Clang analyzer This option is only relevant for those that are using the CAST AIP C Family Extension in order to analyze Objective C source code. This option must be active in order for the Objective C source code to be analyzed by correctly. If this option is invoked and:
The C-Family analyzer is not installed. Please use the Extension Downloader to get it (com.castsoftware.cfamily)
| ||
IDE used to develop the Application/Analysis Unit | Use this option to choose the development environment of your source code files. The CAST Management Studio then applies a default Environment Profile (these can be viewed here: <install_folder>\EnvProf\CPP) that matches the selected Development Environment. If you are analysing Objective C with the C Family Extension, please ensure that you select the Xcode option from the drop down list. Note that if the CAST Delivery Manager Tool detects the source code as a variant of Visual C++, then the appropriate option will be set at Analysis Unit level. | |
STL Support | This option allows you to choose how you want CAST to handle STL header files that are referenced in your source code. Not all other Environment Profiles provided by CAST contain STL header files (for copyright reasons) and this can lead to an incomplete analysis, and thus to incomplete results. As a direct result of this, CAST has introduced this option that allows you to tell the CAST Management Studio whether the STL header files are available or not: | |
CAST emulation | If STL header files are not available in your source code, select this option. This will then force the CAST Management Studio to activate a basic (i.e. non exhaustive) emulation of the most common STL headers (i.e. <string>, <vector>, <algorithm> etc.), thus avoiding an incomplete analysis or ambiguous/erroneous analysis results in most circumstances. This option is provided via a pre-defined Environment Profile, and you can list the headers that are handled by viewing the contents of the following folder: <install_folder>\EnvProf\CPP\STLforUnix | |
STL already in your Source Code Repository | If STL header files are available in your source code, select this option. The STL header files will be analyzed along with the rest of your source code as normal. This is the default option. | |
Use Microsoft Managed C++ extensions (CLR) | Select this option if your Source Code contains Microsoft Managed C++ extensions targeted at the Common Language Runtime (CLR). A corresponding Environment Profile will then be applied. See:<install_folder>\EnvProf\CPP\Microsoft Managed C++ Note that this option is automatically ticked if the project is configured to execute code under the Common Language Runtime virtual machine. |
File Extensions
Consider Files As | C only | If this option is selected, C++ specifics are ignored (templates, namespaces, classes, inheritance and polymorphism) and are not taken into account when the source files are analyzed. This option allows optimized handling of C files. |
C++ only | If this option is selected, C++ specifics (templates, namespaces, classes, inheritance and polymorphism) are taken into account when the source files are analyzed. | |
Both C and C++ | If this option is selected only one distinct job is generated and executed: one C++ technology job using the Consider Files As > C++ option. However the results stored in the CAST Analysis Service will contain both C and C++ object types. In other words, both file types are analyzed as C++ files and Line Of Code Count (LoC) for C files will be included in the C++ technology rather than the C technology. | |
C File Extensions | Use this option to specify the file extensions that will be considered as C files for analysis purposes. | |
C++ File Extensions | Use this option to specify the file extensions that will be considered as C++ files for analysis purposes. | |
Impacts of choosing one parsing option over the other. Selecting one of these options will cause the source code to be handled differently by the analyzer:
|
Includes - only visible at Application and Analysis Unit level
The options Force Include File and Define the Include Paths enable you to define additional paths for files that have been specified in the #include part of your project files. This is to ensure the correct resolution of links to files located in other directories.
The analyzer will take into account the two "include" styles:
In the first case (where an #include uses " "), the analyzer will automatically search the path of the file that contains the #include, THEN the additional paths you have added and in the order specified.
Where < > is used in an #include command, the analyzer will search the additional paths first then, THEN the path of the the file that contains the #include.
Force Include File | This option enables you to specify macros in file format:
Please see the C++ Reference Guide for more information about how this option is handled in CAST Enlighten (links and book marks). | ||||||||||
Define the Include Paths used by the Analysis Unit | This option enables you to add your include paths:
Defining include paths for Microsoft compilers Usually, if the Microsoft C++ compiler is installed on the analysis machine, you just need to select the default "Microsoft VCxxxx" Environment Profile (via the IDE used to develop the Analysis Unit option above). In some cases, you may also need to provide your include list yourself. The following rules should be followed:
In any of the three cases above, you will get an error message during the analysis such as: #error directive encountered 'Use of C runtime library internal header file... (file 'C:\PROGRAM FILES\MICROSOFT[...]\VC\CRT\SRC\CRTDEFS.H")' Include paths for Microsoft compilers should resemble the following: For Microsoft VC 9.0 (2008) and higher:
(the third one is for <windows.h> etc., the exact value for xx.xx depends on your exact installation) For older compilers:
For even older MS Dev 6 (VC98):
|
Macros
Define the macros used by the application/analysis unit
Use this option to define any macros that are present in your source code and that need to be taken into account during the analysis.
Adding a macro |
|
Removing a macro | To remove a macro that you do not want to include in the analysis:
|
Editing a macro | If you want to edit an existing macro:
|
![]()
|
Precompiled Headers (PCH)
Precompiled header | Enter the name of a header file, that the majority of the source code files in the project include first, and that self includes many other library files. Typically "stdafx.h" on most Microsoft projects. |
PCH generator | A source file that includes the Precompiled header file (as referenced above), and that should be analyzed first. Typically "stdafx.cpp" on most Microsoft projects. |
Disable use of PCH | Selecting this option will cause Precompiled headers to be ignored. This is generally not recommended, as PCHs improve analysis speed. |
Parsing
>> allowed to close nested template list | Many compilers allow to close two nested template lists with >> (instead of ">(blank)>" ). There is no reason to deactivate this option, unless "x>>y" is used in any template expression. |
Accept Trigraphs | Select this option only if your code contains trigraphs. The analyzer will then interpret normalized character sequences as a single character - for example ??< will be interpreted as {. Note also that this option will also force the analyzer to accept digraphs. |
Standard scope of "for" loops | Variables declared inside "for" loops are not visible outside the loop. Activating this option could generate messages about unknown variables on some pre-ISO compilers, like Microsoft VC6. |
Standard processing of "typename" | According to the standard, "T::X", not preceded by "typename" (where T is a template parameter) should always be interpreted as an expression. Activating this option is recommended on most compilers, except Microsoft compilers. |
Detect unknown compilation directives | When this option is activated, the analyzer tries to detect compilation directives that have not been defined as macros (e.g. WINAPI and the like). Since this option is not 100% reliable, it is recommended to disable it once the analysis has been properly configured. |
Custom Environment Profiles - only visible at Application and Analysis Unit level
This option enables you to select C/C++ based Environment Profiles that you have created yourself (as oppose to the Environment Profiles that are pre-defined by CAST and applied when the IDE used to develop the Application/Analysis Unit option is set)
Environment Profiles are a set of predefined configuration settings that can be included in an analysis. An Environment Profile can be particularly useful where you have several applications that rely on the same specific settings. By creating an Environment Profile that defines these settings, you then simply include the Environment Profile in the analysis. When the analysis is run, the settings in the Environment Profile are taken into account.
For C/C++ technologies, you can define:
Add a custom Environment Profile
To add a custom Environment Profile:
Add | A dialog box will be displayed listing all existing custom Environment Profiles that have been created: Select the Environment Profile you require and click OK. The profile will then appear in the list. |
Manage Environment Profiles | The Environment Profile Manager will be displayed, enabling you to create your custom Environment Profile: See Using the Environment Profile Manager for more information about how to create new custom Environment Profiles. |
Remove a custom Environment Profile
To remove a profile that you do not want to include in analysis:
You can remove multiple items by selecting the items in the list and then clicking the Remove button.
The Production tab is only visible at Technology and Application level.
Process Settings
Number of Instances | This option is only relevant when the "Legacy analyzer" option is active. It allows you to limit the number of objects held in memory before they are committed to disk during the save process of an analysis. Please contact CAST Support before modifying this option. |
Please see the Dependencies tab for more information about this.
Please see the Reference Pattern tab for more information about this.