Static Code Analyzer Options

This dialog box contains static source analysis options, which are also used for static analysis of software metrics. It is divided into five tabs

General

This tab contains options that determine general source code static code analysis parameters.

Analysis for Symbols Options General tab

Warnings

Source file classes for which warnings will be generated. The options are: Disabled, Disabled For All Headers, Disabled For Standard Library Headers, and Enabled.

Show unresolved externals

Determines whether a lack of definition for found declarations will be reported. This is useful if the project contains parts of the code for which there is no source. (Real Time OS).

Show unused symbols

Enables warnings for unused symbols.

Show global/static's used in one module/function

Enables warnings for global/static symbols used in a module/function.

Check headers on update

Determines if the header files are to be checked when updating the database.

Use default search

If this check box isn't selected, #include "..." behaves like #include <...>.

Use search paths

Determines if the use of logical drive identifiers is permitted in search paths for #include directives. If the check box is selected, a drive identifier is substituted with a value defined in "Environment Substitutes". If there is no such definition, the drive identifier is simply eliminated from the path. For example, if the path has one of the following forms:

:drive:the_path_rest

drive:the_path_rest

drive::the_path_rest (recognized only if "Use VAX/VMS drives" is checked) and there is one of the following definitions in "Environment Substitutes": :drive:=substitution, drive:=substitution ordrive=substitution the resulting path will have the form substitution\the_path_rest.

Use VAX/VMS drives

Determines if the syntax drive:: is legal in specifying paths.

Errors

The maximum number of errors that will be reported before analysis is completed. If this number is set to 0 there is no limit for errors.

Warnings

The maximum number of warnings that will be reported before analysis is completed. If this number is set to 0 there is no limit for warnings.

Environment Substitutes

Apart from environment variables defined in the Windows environment, it is possible, in "Environment Substitutes", also to define "DAC environment variables" in the form of:

env_var=env_string

These substitutions are also necessary if the environment variables of your development environment have been set only in the terminal window in which you build project binaries. As the variables are not known at Windows level, you will have to define them in DAC, in "Environment Substitutes", if you intend to use them.

C Source

This tab contains options for adjusting C source file analysis to the C dialect (compiler) used in a particular project.

Analysis for Symbols Options C Source tab

Maximum identifier length

This is the number of significant characters in the identifiers. The remaining characters are ignored. The default value is 31.

Special table processing

It determines the treatment of arrays of pointers to functions in the analysis. If this check box is selected, such variables are treated as functions, otherwise they are treated in the usual way.

Defines/Control file

It determines the list of macro definitions to be set at the beginning of module preprocessing. Definitions may have the form of:

MACRONAME

(1 is the assumed value), or

MACRONAME=MACROTEXT

A semicolon separates definitions. If macro includes the ";" character, a backslash should precede it: "\;". Leading and trailing white spaces are stripped in MACROTEXT.

This field may contain the name of the control file (absolute or relative in relation to project root) with the prefix "@". Control file lines beginning with -i or -I in the continuation contain the list of directories for searching #include files, separated by a semicolon. The control file lines beginning with -d or -D in the continuation contain the list of macro definitions, as described in the previous paragraph. The remaining control file lines are ignored.

Nested comments

It allows proper recognition of nested C style comments, for example /* /* ... */*/.

C++ comments

It determines whether C++ comments (beginning with "//") are to be recognized while analyzing the source code.

Traditional

It determines if the pre-ANSI preprocessor is to be used. For the traditional preprocessor, a comment is equivalent to nothing, while for the ANSI preprocessor it is a white space. The traditional preprocessor does not delete comments within the #define directive, it does not recognize "#" and "##" operators, and requires an initial "#" in a directive at the very beginning of the line. It allows specification foo() if a macro foo takes a single argument, and permits a macro to be expanded recursively.

Ignore #line

It determines that the #line preprocessor directive be ignored.

Ignore skipped directives

It determines whether unknown directives should be reported as errors in skipped code during preprocessing. 

Example:
#if 0
/* Unknown directive, error not reported if this option is checked. */
#unknown
#endif

Lint Warnings

Analysis for Symbols Options Warnings tab

Report these warnings when enabled

If selected, warnings of a particular type generated during static code analysis will be reported in the Message Logs.

MISRA-C

MISRA-C:1998 / MISRA-C:2004 / MISRA-C:2012

Select set of warnings from MISRA-C guidelines.

Report separately

If this item is checked, selected warnings will be reported under separate MISRA-C Compliance tab in the Message Logs. Otherwise, selected warnings will be reported under Static Code Analysis tab, along with other messages from the static code analysis.

Report these warnings when enabled-selected

Selected warnings will be reported during analysis.

The reporting or MISRA-C Compliance warnings for header files is also affected by the selection in Warnings group, under the General tab of Options > Static Code Analyzer... dialog.

Report unsupported Rules

If checked, messages with lists of unsupported required and advisory rules will be reported during analysis..

Report disabled-unselected Rules

If checked, messages with lists of disabled required and advisory rules will be reported during analysis.

Report uses of MISRA-C #pragma directive

If checked, messages for every usage of MISRA-C #pragma directives will be reported during analysis. For more info about MISRA-C #pragma directives, check "ANSI-C Static Source Code Analyzer" topic..

Unsupported Rules

List of rules that are not currently supported. Some of them could be supported in future releases while others are impossible to support in static code analysis.

MISRA-C Warnings

This tab displays warnings for the standard selected in "MISRA-C" tab.

Use

When this option is active, the template file, otherwise the project file is used.

MISRA-C Template file

MISRA-C warnings configuration can be saved in template file allowing you to switch between MISRA-C configurations. If template file is not set, Project file is used to save MISRA-C Warnings configuration.

Report these warnings when enabled

If selected, warnings of a particular type generated during static code analysis will be reported in the Message Logs.

Save as Template

Allows you to save the current configuration into a (new) template file.

Reload from Project / Reload from Template

Allows you to reset the current configuration to the state in the corresponding file.


Copyright 1993-2017, RistanCASE GmbH