CodeSonar Release 3.3, patchlevel 0: Release Notes

Official release date: November 10, 2008.

Improved Performance

Many of our customers are analyzing projects that consist of millions of lines of code. CodeSonar's deep analysis was taking a while on these large projects. After carefully rearchitecting portions of the analysis engine, the analysis time has been reduced dramatically. For example, analysis time has been reduced by 50 percent to 67 percent on most benchmarks on Windows, Linux, and Solaris. For some customers running on Mac OS X, analysis time has been reduced by 80 percent.

Notes on Upgrading

Other New Features

Warning Filters

Warning filters allow users to perform actions on warnings before they are submitted to the hub. They are controlled through the WARNING_FILTER configuration file variable.

WARNING_FILTER rules specify an action to be carried out on any warning that matches a list of conditions. The available actions are:

New Warning Classes

CodeSonar now includes checks for the following warning classes.

New GUI Functionality

The following changes have been made to the CodeSonar Web GUI.

New Configuration File Parameters

New Parameter Notes
CHECK_MINSCOPE Specifies whether or not CodeSonar will carry out checks for Scope Could Be Local Static and Scope Could Be File Static warnings.
CHECK_PARAM_DEREFS Specifies whether or not CodeSonar will carry out checks for Unchecked Parameter Dereference warnings.
CHECK_UNBOUNDED_LOOPS Specifies whether or not CodeSonar will carry out checks for Potential Unbounded Loop warnings.
CHECK_STACK_DEPTH Specifies whether or not CodeSonar will carry out checks for Excessive Stack Depth warnings.
CODEWARRIOR_INSTALLS Specifies CodeWarrior install directories for which compiler IDE plugin invocations should be intercepted.
CODEWARRIOR_PLUGINS Specifies individual CodeWarrior compiler IDE plugins whose invocations should be intercepted.
COMPILER_MODELS Defines a map from compiler executable basenames to compiler models. Replaces hook option -model and the Windows build wizard Tools dialog.
DISABLED_COMPILERS Specifies executables whose execution should not be treated as a compiler invocation by the CodeSonar project builder. Replaces hook option -disable-compiler and the Windows build wizard Tools dialog.
FORCE_ENVIRONMENT Prevents the software build system (e.g., make) from overwriting environment variables necessary for proper process hooking on POSIX systems.
FOREGROUND [Command line builds only] Specifies whether or not a "codesonar hook-html" command will run the analysis in the codesonar hook-html process itself.
HOOK_LOG Instructs CodeSonar to log all process invocations inside a hook or hook-html sub-command to the specified file.
HUB_ADDRESS [Command line builds only] Specifies the hub address CodeSonar should use.
IGNORED_COMPILATION_COMMANDS Specifies compilation command lines that should be ignored by the CodeSonar project builder.
INVOKE_COMPILER_FIRST Specifies whether or not to invoke the real compiler before invoking the CodeSonar parser. Replaces hook option -invoke-compiler-first.
SPAWN_HUB [Command line builds only] Specifies whether or not "codesonar hook" or "codesonar hook-html" will create a new hub if the hub is not already running.
STACK_DEPTH_THRESHOLD The call stack size, in bytes, beyond which CodeSonar issue Excessive Stack Depth warnings (if CHECK_STACK_DEPTH is set to Yes).
STACK_DEPTH_ACTIVATION_RECORD_CONSTANTS Allow the user to estimate the size of various elements that contribute to the size of the call stack.
STACK_DEPTH_COMPILER_PADDING
STACK_DEPTH_UNDEFINED_FUNCTION_SIZE
TOKEN_RENDERER_CAPACITY Control aspects of token highlighting.
TOKEN_RENDERER_BACKOFF_CAPACITY
TOKENS_PER_LINE
UNIX_TEXT_MODE Instructs CodeSonar to perform crlf -> lf translations on stdout and stderr and do the inverse on stdin. Replaces hook option -unix-text-mode.
USE_SERVICES [Windows only] Specifies whether or not CodeSonar hub and launch daemon processes will be created as Windows services.
WARNING_FILTER Allows warnings to be modified before they are submitted to the hub, or discarded entirely without being submitted.

New Plug-In API Function

There is one new function in the CodeSonar Plug-In API.

C:
cs_boolean csonar_warningclass_always_discarded(
    cs_warningclass_t wclass)
Scheme:
(codesonar:warningclass-always-discarded?
    wclass)
Check whether instances of class wclass are always being ignored due to WARNING_FILTER settings in the configuration file.

New General-Purpose API Functions

C function Scheme function Description
cs_const_string cs_ast_dump(
    cs_ast ast, 
    cs_integer depth)
(ast-dump 
    ast
    depth)
Get an ASCII art tree rendering of ast with attribute subtrees bounded to depth.
cs_result cs_pdg_formal_in(
    cs_pdg pdg, 
    cs_integer fi_rank, 
    cs_pdg_vertex *out_vertex)
(pdg-formal-in 
    pdg
    fi_rank)
Retrieve the PDG_VERTEX corresponding to the formal-in parameter of pdg with rank fi_rank.
cs_result cs_pdg_formals_out_as_list(
    cs_pdg pdg, 
    cs_pdg_vertex pdg_vertex_list[], 
    cs_size_t capacity_bytes, 
    cs_size_t * bytes_needed)
(pdg-formals-out-as-list 
    pdg)
Retrieve a list containing the formal-out vertices of pdg in the order in which they occur in the code.

Removed

Deleted Hook Options

Hook options have been removed in favor of configuration file parameters. The replacement parameters are shown in the table below.

Retired Hook Option Replacement Configuration File Parameter
-disable-compiler compiler-name DISABLED_COMPILERS
-invoke-compiler-first INVOKE_COMPILER_FIRST
-model compiler-name model-name COMPILER_MODELS
-unix-text-mode UNIX_TEXT_MODE

Functionality Removed From Windows Build Wizard

Paralleling the removal of hook options, some functionality has been removed from the Windows build wizard.

Deleted Configuration File Parameters

The following configuration file parameters have been removed.

Deleted Parameter Notes
COLLAPSE_SOURCE CodeSonar now always stores a copy of each file instance.
CLUSTER_WARNINGS_BY_STARTPOINT Ceased to be meaningful with CodeSonar 3.0.