JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


The xcc Compiler Model

The xcc compiler model is provided for cases where none of the CodeSonar Compiler Models are suitable.

In other cases, you may be able to use the customizable C compiler model, xcc. This model accepts the CodeSonar front end options, but allows the user to specify additional preprocessor and command-line information. It is also useful for users who have written a custom front end for CodeSonar.



Prerequisites

The following are the prerequisites for using the xcc compiler model:

Options Recognized

Except for the following, all options are silently ignored.

@fname Inserts the contents of file fname into the argument list.
-Dmacro Defines macro macro to 1.
-Dmacro=def Defines macro macro to def.
-Idir Appends directory dir to the list of directories searched for include files.
-Umacro Undefines macro macro.
-config filename Look in filename for configuration information. If neither -config filename nor -noconfig is specified, the default settings shown in the table below are used.
-noconfig Use the default configuration settings.

xcc configuration file

The configuration file contains one entry per line, where each optional entry is a symbol followed by the value associated with that symbol. The entries can occur in any order. The recognized symbols are described in the following table:

Symbol Value Description Default
cflags zero or more strings,
space-separated
Can contain -D, -U and -I arguments, along with front end options. This list will be inserted on the command line before any other options when the CodeSonar front end is invoked. Note that these flags will not be passed to the compiler. empty list
nary-args zero or more string-integer pairs,
space-separated
An additional list of arguments to be ignored. The second item in the pair indicates how many of the subsequent arguments should also be ignored. empty list
front-end string The location of the executable used for the front end. This option is only useful if the user has customized CodeSonar to use an alternative front end for a different language. "cprocess"
csuffix string A regular expression describing valid suffixes of C source files in the language. "(c|C)"
cxxsuffix string A regular expression describing valid suffixes of C++ source files in the language. "[cC]([pP][pP]|[xX][xX])"

Here is a sample configuration file:

cflags "-DMYCC" "-I/usr/local/mycc/include")
nary-args "-xl" 1 "-pl" 2
front-end "/home/alex/bin/xprocess"
csuffix "(x|XX)"
cxxsuffix "xcc"

The name of the configuration file used for each compilation is saved for each compilation unit. Internal rebuilds will use the same configuration file (or none) as was specified on the command line.

To make it easier to use the customizable compiler model consider the following tips:

Predefined Macros

The xcc compiler model defines the following in addition to the standard CodeSonar predefined macros.

__EDG__=1  
__EDG_VERSION__ An integral value that encodes the version number of the EDG C front end used by the model. If the front end version is MAJOR.MINOR, the value is MAJOR*100+MINOR.
 

To report problems with this documentation, please visit https://support.codesecure.com/.