C Code Review Compiler - crccc

Purpose

The C Code Review Compiler compiles C source files for code review static analysis. It produces an .xob output file, which must be linked by using the C Code Review Linker crcld.

Syntax

crccc <source> <xob> <def> <opp> [<options>]

where:

  • <source> is the C source file under analysis.

  • <xob> is the name of the generated object file.

  • <def> is the standard definitions file. This file is searched in the $ATLTGT directory.

  • <opp> is the parser options file. This file is searched in the $ATLTGT directory.

Description

Analyses the code and produce an .xob object file for use with the C Code Review Linker (crcld).

Options

Command line options can be abbreviated to their shortest unambiguous number of characters and are not case-sensitive.

[-RULE= <file>]

Specifies the code review rule configuration file. A default internal configuration rule set is used as the default rule.

[-INCL= <directory>{[,<directory>]}]

Specifies the locations of included files.

[-STD_INCL= <directory>[,<directory>]]

Specifies the location of additional system include directories.

[-CHECKSYSINCLUDE]

By default, files from system include directories are not analyzed by Code Review. Use this options to force the analysis of system include files.

[-DEFINE= <ident>[ = <value>] {[, <ident>[ = <value>]}]

This option specifies conditions to be applied when the Code Review Compiler starts. These conditions allow you to define C symbols that apply conditions to the generation of any IF ... ELSE ... END IF blocks in the test script.

If the option is used with one of the conditions specified in the IF instruction, the IF ... ELSE block (if ELSE is present) or the ELSE ... END IF block (if ELSE is not present) is analyzed and generated. The ELSE ... END IF block is eliminated.

If the option is not used or if none of the conditions specified in the IF instruction are satisfied, the ELSE ... END IF block is analyzed and generated.

All symbols defined by this option are equivalent to the following line in C.

-define <ident> [<value>]

By default, the ELSE ... END IF blocks are analyzed and generated.

[-UNDEF= <identifier>[, <identifier>]]

Allows you to undefine symbols. This is equivalent to the -U option of the compiler.

[-ENTRYPOINTS=<function name>[,<function name>]]

Speficy entry point(s) of your project to avoid to start the rules about functions that is never called (Rule M2.2.2 in Misra 2012, Rule E16.50 in Misra 2012).

main is the default entrypoint.

[-VERSION]

Display crccc version and exit.

[-SILENT[=<number>]]

Display only <number> of failed rules on console (no impact in final report).

if <number> is not provided, by default the value is 0.

[-FILEVERSION=<version>]

Allow users to add a version that is included in final report.

Example

crccc mysource.c output.xob atus_c.def atl.opp

-rule=$TESTRT_DIR/plugins/Common/lib/confrule.xml

Related Topics

Code review overview | Running a code review | C Code Review Linker - crcld