CustomToolchain

Custom C/C++ compiler toolchain

This rule configures aspects of the custom C/C++ compiler to emulate.

You have to choose exactly one of the compiler profiles in a project configuration.

Options

The following places define options that affect this rule: Project-GlobalOptions

advanced

Advanced options.
 

advanced.captured_environment : set[bauhaus.analysis.config.GlobPattern] = {'*INCLUDE', '*PATH', '*ROOT', 'AXIVION_*', 'BAUHAUS_*', 'CAFE*', 'IRLINK_*'}

Glob patterns for environment variables that should be captured and stored in the IR.
 

advanced.compiler_version_guessing : dict[bauhaus.analysis.config.SearchPattern, str] = {}

If the option language_*.emulated_compiler_version is not specified, the regular expressions in this option are used to automatically detect a compiler version. If one of the regular expression matches one of the system include paths, the associated value is used as a compiler version.

For example, the configuration { "MSVC\\14\.(\d\d)\.": "19$1" } will automatically use version 1916 for the typical Visual Studio 2017 include path C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include.

This allows using the MicrosoftToolchain without any configuration as long as the INCLUDE environment variable is set (usually by vcvarsall).

 

advanced.default_source_encoding

Type: SourceFileEncoding

Default: 'UTF8'

The default encoding that the compiler will use to read source files if the --unicode_source_kind switch is not in use and the file does not have a byte-order mark.
 

advanced.filemap

Type: dict[typing.Pattern[str], str]

Default:

{
   '/cygdrive/([A-Za-z])/(.*)': '$1:/$2'
}
Filename mapping where the key part is a regular expression and the value part the replacement. For example, the key ^/cygdrive/([A-Za-z])/(.*) and the value $1:/$2 map CygWin paths to regular Windows® paths.

The filemap is applied to all paths specified on the command-line. It is also applied to the include+library paths specified in environment variables and directly in the compiler configuration.

The regular expression must match the complete path as specified on the command-line: it acts as if anchored with ^ and $. The value uses $N place-holders for the value of the capture group number N.

 

advanced.ignore_include_globbings : set[bauhaus.analysis.config.FileGlobPattern] = set()

Every #include filename is checked against these patterns (without filename normalizations), and if it matches a pattern, the #include is skipped instead of actually including the file. This can be useful for preprocessor-only files like MemMap.h to accelerate compilation and reduce object file sizes.

However it can also lead to compiler errors if any macro definitions in the header were necessary to compile the remainder of the program. If the ignored file is not preprocessor-only, but actually declares symbols, this option should not be used: the missing symbols will cause compiler errors, which will impact the analysis of code using those symbols.

An alternative to this option is the no_macros_for_path_globbings option: the compiler will still read the header, but avoid storing information about macro invocations or #if directives in the IR.

 

advanced.ignore_translation_unit_globbings : set[bauhaus.analysis.config.FileGlobPattern] = set()

Every primary source file (.c/.cpp) filename is checked against these patterns (with the source file name relative to the base path). Any source file that matches will not be compiled; instead our compiler will create an empty object file.

This option is useful for excluding third-party libraries from compilation and analysis in cases where the build system does not offer an easy way to skip calling the compiler for that library.

 

advanced.main_entries : set[str] = {'main'}

Set of function names that are considered the main entry point to the analyzed code. There should be only one such function per linked system.

See also the configuration for additional entry points: /Analysis/AnalysisControl/Environment/EntryPoints

 

advanced.no_macro_invocations_for_system_headers : bool = True

If enabled, avoid storing macro invocations that occur within system headers. Additionally this option also avoids storing preprocessor #if constructs.

This setting helps save compilation time and keep the IRs smaller. The missing macro invocations usually do not cause issues because system headers are excluded from analysis.

When this setting is enabled and the analysis of system headers is also enabled (exclude_messages_in_system_headers=False on the stylecheck rules), violations in system headers will be reported without information about the macro context.

Note that the default setting of this option (True) may lead to false positives in files that are inconsistently included as both system headers (-isystem) and user headers (-I). In this case you will also receive the Linker-User_System_Include_Mismatch warning. If you cannot solve the cause of this warning, you will need to disable this option (set no_macro_invocations_for_system_headers = False).

 

advanced.no_macros_for_path_globbings : set[bauhaus.analysis.config.FileGlobPattern] = set()

Every source file or header is checked against these patterns (with the filename relative to the base path (-B)). If the file matches, cafeCC will avoid storing macro invocations and #if constructs in the IR.

This setting helps save compilation time and keep the IRs smaller. It especially helps with macro-heavy headers, e.g. Autosar MemMap.h-style headers.

If the same files are also excluded from analysis, the missing macro invocations usually will not cause issues. If files affected by this option are analyzed, the missing macro invocations can lead to false positives (e.g. "Use of literal zero (0) as null-pointer-constant, use macro NULL instead" will have false positives because without storing macro invocations, the analysis won't know that the code is already using NULL).

 

advanced.pch

Advanced options for PCHs.

Precompiled headers require cafe to mmap the precompiled header at the same address where it was in the cafe process that created the PCH. This requires picking an address during PCH creation time that will later still be free in the processes using the PCH.

These options control which address cafe uses for the precompiled header memory map. You can configure either a fixed_address or the inputs for the search logic that looks for a free memory segment in the PCH-creating process.

 

advanced.pch.base : str = '0x000043a700000000'

Starting address for the search logic that finds a free memory segment.
 

advanced.pch.debug : bool = False

Whether debugging output for PCHs should be activated.
 

advanced.pch.fixed_address : str | None = None

If set, must be a hexadecimal memory address. The address will used to allocate the PCH memory segment. If not set, the address will be automatically determined using the search logic
 

advanced.pch.size : str = '0x0000000400000000'

Minimum size of the free memory region that will be accepted by the search logic.
 

advanced.pch.step : str = '0x0000001000000000'

Step size for the search logic that finds a free memory segment.
 

advanced.pch.stop : str = '0x00006FF000000000'

Stop address for the search logic that finds a free memory segment.
 

advanced.response_file_threshold : int = 8000

Configures the maximum number of bytes that are passed from cafeCC to subprocesses directly. If the command line exceeds this amount, then a response file is used.
 

archiver

Configuration for the archiver tool.
 

archiver.command : str = ''

Archiver tool to call when doing an Axivion build.

If set to an empty string, cafeAR will be called (llvm-ar variant shipping with Axivion Suite).

 

archiver.native_archiver : str | None = '$(AR=)'

Executable to invoke when calling the native archiver tool.

This option is used by the irAR tool when performing a native build combined with the Axivion build.

If unset, then whatever is configured as command is used also as native archiver tool.

 

archiver.native_lto_ranlib : str | None = None

Executable to invoke when calling the native gcc-ranlib wrapper tool.

This option is used by the irLTORANLIB tool when performing a native build combined with the Axivion build.

If unset, then gcc-ranlib is used also as native archiver tool.

 

archiver.native_ranlib : str | None = '$(RANLIB=)'

Executable to invoke when calling the native ranlib tool.

This option is used by the irRANLIB tool when performing a native build combined with the Axivion build.

If unset, then ranlib is used also as native archiver tool.

 

archiver.option : str = ''

Option to add to the archiver command when doing an Axivion build.

If set to an empty string, cr will be used (create output if missing, insert/replace into archive). Alternatively, to emulate different archiver behavior, you could e.g. use cqL (create output if missing, quick-append, flatten recursive archives), or even add letter T for "thin archives".

 

archiver.response_file_format

Type: ResponseFileFormat

Default: 'backslash_always_escapes'

Format to use when options are passed on to the archiver via a response file. This must be set to the file format expected by the configured archiver.
 

archiver.response_switch : str = '@'

Switch to use when passing options to archiver in a response file when doing an Axivion build.
 

archiver.use_thin_archives : bool = False

If enabled, enforce calls to the internal archiver tool cafeAR to create thin archives instead of normal ones when being called via cafeCC or irAR (it has no effect when calling cafeAR directly, as this does not read the configuration at all).

Thin archives can be used to save disk space, but also in combination with linker.include_unused to better parallelize the linking step.

 

default_mode

default_mode : CompilerMode = 'Link'

The default mode when not overridden by a command-line switch.

A typical switches.mapping will define the following switches to change the mode:

  • -c: Compile
  • -E: Preprocess
  • -archive: Archive
 

environment

environment : dict[str, str] = {}

Environment for extending the call of cafeCC. These entries are added to the environment and existing ones will be overwritten. These environment variables will be passed to the custom preprocessor/postprocessor commands.
 

external_postprocessor

If this feature is enabled, cafeCC will automatically run an external program on the resulting IR file after compiling or linking.
 

external_postprocessor.command : str = 'axivion_analysis'

External command to call for external postprocessing after IR file is generated. The IR file name will be passed as the last argument on the command line.
 

external_postprocessor.enabled : bool = False

Enable calling external command after compiling/linking.
 

external_postprocessor.options : list[str] = ['--quiet', '--brief', '--omit_disabled', '--ir']

Options to pass to the external post-processing command. The IR file name will be appended to this list of options.
 

file_extensions

The file extensions used for source files, object files and library files. Used when searching for files and when files are created without an explicitly specified output filename.
 

file_extensions.assembler : set[str] = {'.S', '.asm', '.s'}

File extensions for assembler.
 

file_extensions.c : set[str] = {'.c', '.h', '.i'}

File extensions for the C language.
 

file_extensions.cpp : set[str] = {'.C', '.H', '.c++', '.cc', '.cpp', '.cxx', '.h++', '.hh', '.hpp', '.hxx', '.ii', '.inl', '.preinc', '.tcc'}

File extensions for the C++ language.
 

file_extensions.cuda : set[str] = {'.cu', '.cuh'}

File extensions for the CUDA language.
 

file_extensions.ignore : set[str] = {'.res'}

File extensions of files that are irrelevant and should be ignored.
 

file_extensions.library : list[str] = ['.so', '.dll', '.dylib', '.a', '.lib']

File extensions used when searching for libraries with the cafeCC -l switch. The order is relevant. An extension earlier in the list is preferred over an extension later in the list.
 

file_extensions.object : str = '.o'

The file extension used for object files that are created without an explicitly specified output filename.
 

file_extensions.qml : set[str] = {'.qml'}

File extensions for QML files.
 

file_extensions.response : set[str] = {'.rsp'}

File extensions of files that should be treated as compiler response files containing further switches to the tool.
 

language_c

Configuration that applies when compiling C code.
 

language_c.default_options : list[str] = []

Options being prepended to the Axivion compiler (cafe) call.
 

language_c.emulated_compiler : EmulationMode = 'None'

Enabling an emulation mode has wide-ranging effects:
  • activates support for vendor-specific language extensions
  • sets some predefined macros
  • emulates some compiler bugs
This corresponds to the --microsoft, --gcc / --g++ and --clang command-line switches.
 

language_c.emulated_compiler_version : int | None = None

The version of the compiler to emulate.

Examples:

  • --gnu_version=48010 emulates GCC 4.8.1
  • --gnu_version=100200 emulates GCC 10.2
  • --clang_version=100000 emulates Clang 10.0
  • --microsoft_version=1903 emulates Visual Studio 2015 Update 3
  • --microsoft_version=1916 emulates Visual Studio 2017 Update 9
  • --microsoft_version=1929 emulates Visual Studio 2019 Update 11
If this option is not specified, cafeCC will attempt to automatically detect it using the advanced.compiler_version_guessing logic (if any). Otherwise it defaults to the latest version of the emulated compiler that is supported by Axivion.

Note that our MSBuild integration will pass the --microsoft_version switch on the command-line, and thus overrides this configuration setting.

For gcc, this option should be configured to (10000 * __GNUC__) + (100 * __GNUC_MINOR__) + (__GNUC_PATCHLEVEL__).
For Clang, this option should be configured to (10000 * __clang_major__) + (100 * __clang_minor__) + (__clang_patchlevel__).
For MSVC, this option should be configured to the value of _MSC_VER. You can find a table of Visual Studio versions in the Microsoft documentation for _MSC_VER .

 

language_c.features

Provides fine-control for individual language features. These options allow enabling language constructs outside the mode where they would normally be enabled.

For example, the GNU __attribute__((...)) syntax can be activated without activating the full GCC emulation mode.

All options in this group can be overwritten by the corresponding command-line options.

 

language_c.features.alternative_tokens : bool | None = None

Enables recognition of digraphs and (in C++) operator keywords.
int main(int argc, char** argv) <%
    if (1 < argc and argc < 10);
%>

In C mode, this option only controls the recognition of digraphs. The keywords are instead handled as macros in iso686.h.

If this option is not specified, it defaults to the behavior of the emulated compiler.

Corresponds to the --alternative_tokens / --no_alternative_tokens command-line option.

 

language_c.features.at_as_letter : bool = False

Enables support for character at (@) inside identifiers or keywords, such as @near.

Corresponds to the --at_as_letter command-line option.

 

language_c.features.at_operator : bool = False

Enables support for the int variable @ address; syntax.

Corresponds to the --at_operator command-line option.

 

language_c.features.binary_literals : bool | None = None

Controls support for binary literals (0b01010).

If not specified, binary literals are enabled in C++11 mode, Microsoft mode version≥1900, and GNU mode version≥40300.

Corresponds to the --binary_literals / --no_binary_literals command-line options.

 

language_c.features.c11_atomic : bool = False

Enables support for C11 _Atomic outside of C11 mode.

Corresponds to the --c11_atomic command-line option.

 

language_c.features.c11_generic : bool = False

Enables support for C11 _Generic outside of C11 mode.

Corresponds to the --c11_generic command-line option.

 

language_c.features.c99_complex : bool = False

Enables support for C99 _Complex and _Imaginary.

In GNU/Clang mode, this option enables _Imaginary and changes the type of __I__ from _Complex float to _Imaginary float. In standard C99 mode, this option has no effect. In other modes, this option can be used to enable C99 complex numbers without enabling all of C99 mode.

Corresponds to the --c99_complex command-line option.

 

language_c.features.c99_inline : bool = False

Enables support for C99 inline outside of C99 mode.

Corresponds to the --inline command-line option.

 

language_c.features.c99_restrict : bool = False

Enables support for C99 restrict outside of C99 mode.

Corresponds to the --restrict command-line option.

 

language_c.features.clang_feature_test_macros : bool = False

If enabled, the following Clang-style feature test macros are available (also in non-Clang modes): __has_feature, __has_extension, __has_attribute, __has_builtin, __has_include_next, and __is_identifier.

Corresponds to the --clang_feature_test_macros command-line option.

 

language_c.features.designated_initializers : bool | None = None

Controls support for designated initializers:
{ .a = 1, .b = 2 }
This feature is enabled automatically in C99 mode, C++20 mode, all GCC and Clang modes, and in Microsoft C mode version≥1800.

Corresponds to the --designators / --no_designators command-line options.

 

language_c.features.dollar_in_identifiers : bool = False

If enabled, allows the usage of dollar ($) characters in identifiers.

Corresponds to the --dollar command-line option.

 

language_c.features.flexible_array_members : bool = False

Enables support for C99-style flexible array members:
struct S {
    int len;
    int data[];
};
This feature is enabled automatically in C99, Microsoft, GCC and Clang modes. This option allows enabling the feature in other modes.

Corresponds to the --flexible_array_members command-line option.

 

language_c.features.gnu_attributes : bool = False

Enables support for GNU-style __attribute__((...)) outside of gcc mode.

Corresponds to the --gnu_attributes command-line option.

 

language_c.features.iar_floats : bool = False

Enable IAR-style float literals 0.NaN and 0.Infinity.

Corresponds to the --iar_floats command-line option.

 

language_c.features.ignore_tokens : bool = False

Enables the following special keywords:
  • __ignore_next_token: The token after this token is skipped.
  • __ignore_till_semicolon: All tokens until the next semicolon are skipped.
  • __ignore_next_brackets: The next matching pair of brackets (braces, parentheses, etc.) including their content are skipped.
  • __ignore_next_brackets_or_till_semicolon: Behaves like __ignore_next_brackets except if a semicolon appears before the first opening bracket, in which case it behaves like __ignore_till_semicolon.
  • __ignore_init: An initialization following this token is skipped.
The typical use of these keywords is to ignore vendor-specific language constructs that are not supported by cafeCC. For example, consider the following code:
interrupt [42] void my_irq42_handler(void)
{
}
cafeCC does not support this interrupt construct. With #define interrupt __ignore_next_brackets, cafeCC will ignore the interrupt vector entry and successfully parse the function definition.

Corresponds to the --ignore_tokens command-line option.

 

language_c.features.includes_both_sys_and_nonsys : bool = False

Disables warnings if include directories are specified both as system include directory and non-system include directory. For some compiler and their build systems this is default and warnings thereof are undesired.

Corresponds to the --diag_suppress=incl_dir_both_sys_and_nonsys command-line option.

 

language_c.features.incompatible_ptr_conversion : bool = False

If enabled, implicit conversions between incompatible pointer types are allowed.

Corresponds to the --incompatible_ptr_conversion command-line option.

 

language_c.features.language_strictness

Type: LanguageStrictness

Default: 'default'

Enables strict ANSI/ISO mode, which provides diagnostic messages when nonstandard features are used, and disables features that conflict with ANSI/ISO C or C++. ANSI/ISO violations can be issued as either warnings or errors depending on the selected option.

Corresponds to the --strict_warnings and --strict command-line options.

 

language_c.features.stdarg_builtin : bool | None = None

Enable or disable special treatment of the stdarg.h header.

When enabled, the stdarg.h and cstdarg headers are treated as builtins, i.e. our compiler will not read these system headers but instead use its own builtin definitions for the macros that should be defined there.

If unset, it is mode-dependent: It is enabled in all modes except GNU/Clang modes.

 

language_c.features.terse_static_assert : bool = False

If enabled, the C23 terse _Static_assert and the C++17 terse static_assert (i.e. one with only a single argument) are supported.

Corresponds to the --terse_static_assert command-line option.

 

language_c.features.trigraphs : bool = False

Enables recognition of trigraphs.
int main() ??< ??>

Trigraphs are not enabled by default in any compiler mode.

Corresponds to the --trigraphs / --no_trigraphs command-line option.

 

language_c.features.universal_asm : bool = False

Enables support for inline assembler syntax in various formats:
  • #pragma asm / #pragma endasm
  • #asm / #endasm
  • asm("nop")
  • asm volatile("RRX %0, %1" : "=r"(result) : "r" (value) );
  • __asm int 3
  • asm { mov al, 2; mov dx, 0xD007; out dx, al }
  • asm void f(void) { mov r0, #0 }
The asm and __asm keywords can be used interchangeably.

Corresponds to the --universal_asm command-line option.

 

language_c.features.unrecognize_pragma_pack : bool = False

Disables default recognition of #pragma pack(). This can be necessary if the original compiler uses #pragma pack but in a different syntactic way than what is typical for #pragma pack.

Corresponds to the --unrecognize_pragma=pack command-line option.

 

language_c.features.variable_length_arrays : bool | None = None

Controls support for C99 variable length arrays (VLA):
void test(int n) {
    int arr[n];
}

If not specified, VLAs are enabled in C99 mode and GNU mode.

Corresponds to the --vla / --no_vla command-line options.

 

language_c.features.variadic_macros

Type: VariadicMacros

Default: 'default'

Controls support for C99 variadic macros:
#define eprintf(...) fprintf (stderr, __VA_ARGS__)
And support for extended variadic macros:
#define eprintf(args...) fprintf(stderr, ## args)

If set to default, variadic macros are enabled in C99 mode, C++11 mode, GNU mode, and Microsoft mode version≥1400.

Corresponds to the --variadic_macros / --no_variadic_macros / --extended_variadic_macros / --no_extended_variadic_macros command-line options.

 

language_c.features.void_ptr_arithmetic : bool = False

If enabled, pointer arithmetic is also allowed on pointers to void.

Corresponds to the --void_ptr_arithmetic command-line option.

 

language_c.language_version

Type: CLanguageVersion

Default: 'C18'

Language version used by default (when not using a compiler switch like -std).
 

language_c.native_compiler : str | None = None

Executable to invoke when calling the native compiler tool.

This option is used by the irCC/irCXX tools when performing a native build combined with the Axivion build.

 

language_c.preprocessing

Options for preprocessing.
 

language_c.preprocessing.extension : str = 'i'

Extension to use for preprocessed files.
 

language_c.preprocessing.external_preprocessor

Configuration of the external preprocessor being used when enabled.
 

language_c.preprocessing.external_preprocessor.command : str = 'gcc'

External command to call for external preprocessing. The command must accept include paths with -I, macro definitions with -D and macro undefinitions with -U. The input file has to be the last argument on command-line and the preprocessed output has to go to stdout.
 

language_c.preprocessing.external_preprocessor.enabled : bool = False

Enable external preprocessor instead of internal one.
 

language_c.preprocessing.external_preprocessor.options : list[str] = ['-E']

Options to pass to the external preprocessor
 

language_c.preprocessing.external_preprocessor.response_file_format

Type: ResponseFileFormat

Default: 'argument_per_line'

Format to use when cafeCC writes options for the preprocessor to a response file. This must be set to the file format expected by the configured external preprocessor.
 

language_c.preprocessing.external_preprocessor.response_switch : str = '@'

Switch to use when passing options in a response file.
 

language_c.preprocessing.immutable_macros : set[str] = set()

Lists names of macros that cannot be modified. Any attempt to change the macro value via #define or #undef will be ignored.

If the macro has an initial value configured in predefined_macros, that value will be unchangeable within the whole compilation unit.

If the macro is not predefined, it will remain undefined in the whole compilation unit.

This option is equivalent to a use of #pragma immutable_macro at the beginning of the first preinclude file.

 

language_c.preprocessing.predefined_macros : dict[str, str] = {}

Allows predefining macros. Keys in this dictionary are the macro names. The values are the replacement texts that macro invocations are replaced with.

You can define function-like macros by including the parameter list in the dictionary key. Example: { "CONCAT(X, Y)": "X ## Y" }

Typically, this configuration option is filled by using a compiler setup script like gccsetup which extracts the predefined macros from the native compiler.

Note: some macros can be automatically predefined by the compiler frontend without being configured here.

__DATE__, __TIME__, __LINE__, __FILE__, __BASE_FILE__, __FILE_NAME__: Always automatically defined.
__COUNTER__, __TIMESTAMP__, __INCLUDE_LEVEL__: Always automatically defined.
__SIGNED_CHARS__: Defined iff the char type is signed.
__STDC__, __STDC_VERSION__, __STDC_HOSTED__: Defined according to selected C version.
__cplusplus: Defined according to selected C++ version
__cpp_*: WG21 SG10 SD-6 feature-test macros are automatically defined for features that are enabled in the current compiler mode.
__STDCPP_DEFAULT_NEW_ALIGNMENT__: Automatically defined in C++ modes where the "overaligned allocations" feature is enabled.
__AXIVION__, __AXIVION_VERSION__: Always automatically defined.
__EDG_SIZE_TYPE__, __EDG_PTRDIFF_TYPE__: Always automatically defined.

The values of the automatically predefined macros can be overridden using this configuration option.

 

language_c.preprocessing.sys_framework_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

System framework include search path (macOS specific).

The entries in this list will be passed to the preprocessor and compiler with --sys_framework_search_path=value.

Any header files found in the system framework include search path are considered system headers, and will be excluded from analysis by default.

 

language_c.preprocessing.sys_include_envvar : str | None = None

Name of environment variable that contains the system include search path. If an environment variable with this name exists, its value is split using the host-specific path separator and the resulting list is appended to the sys_include_path option.
 

language_c.preprocessing.sys_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

System include search path.

The entries in this list will be passed to the preprocessor and compiler with --sys_include=value.

Any header files found in the system include search path are considered system headers, and will be excluded from analysis by default.

 

language_c.preprocessing.user_framework_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

User framework include search path (macOS specific).

The entries in this list will be passed to the preprocessor and compiler with --framework_search_path value.

 

language_c.preprocessing.user_include_envvar : str | None = None

Name of environment variable that contains the user include search path. If an environment variable with this name exists, its value is split using the host-specific path separator and the resulting list is appended to the user_include_path option.
 

language_c.preprocessing.user_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

User include search path.

The entries in this list will be passed to the preprocessor and compiler with -I value.

 

language_c.preprocessing.vendor_predefined_macros : bool = True

This option defines whether vendor-specific predefined macros should be automatically set (the default) when operating in a respective emulated_compiler mode (e.g. GNU, Clang, or Microsoft), or not.

The affected macros are:

__GNUC__, __GNUG__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, __VERSION__, __GXX_RTTI, __GNUC_STDC_INLINE__, __GNUC_GNU_INLINE__, __CHAR16_TYPE__, __CHAR32_TYPE__ in GNU emulation mode.
__clang__, __clang_major__, __clang_minor__, __clang_patchlevel__, __clang_version__ in Clang emulation mode.
__STRICT_ANSI__: Defined when the compiler is invoked in a strict ISO C or ISO C++ conforming mode, e.g. with the switch -std=c*.
__GXX_EXPERIMENTAL_CXX0X__ in GNU and Clang emulation modes if using C++11 or newer.
__GLIBCXX_BITSIZE_INT_N_0 and __GLIBCXX_TYPE_INT_N_0 in -std=gnu++* modes.
_MSC_VER, _MSC_FULL_VER, _MSC_BUILD, _MSC_EXTENSIONS, _WIN32, _M_IX86, _MSVC_LANG, _MSVC_TRADITIONAL, _MSVC_EXECUTION_CHARACTER_SET in Microsoft emulation mode.
_WIN64, _M_AMD64, _M_X64 additionally in 64-bit Microsoft emulation mode.

 

language_cuda

Configuration that applies when compiling CUDA code.

This is configuration is in addition to the C++ configuration (language_cxx).

 

language_cuda.additional_cuda_options : list[str] = []

Options passed to the Axivion compiler (cafe). These options are inserted directly after language_cxx.default_options.

This option takes effect only when compiling CUDA source files, and not when using irNVCC on C or C++ files.

 

language_cuda.additional_library_path : list[bauhaus.analysis.config.LayerRelativePath] = []

Library search path for CUDA compilation. The entries in this option are effectively prepended to language_cxx.preprocessing.library_path.

This option takes effect when linking with irNVCC.

 

language_cuda.additional_predefined_macros

Type: dict[str, str]

Default:

{
   '__CUDACC_VER_BUILD__': '80',
   '__CUDACC_VER_MAJOR__': '13',
   '__CUDACC_VER_MINOR__': '1',
   '__CUDA_API_VER_MAJOR__': '13',
   '__CUDA_API_VER_MINOR__': '1',
   '__NVCC_DIAG_PRAGMA_SUPPORT__': '1',
   '__NVCC__': '1'
}
Predefined macros for CUDA compilation; in addition to those predefined by the language_cxx.preprocessing.predefined_macros option.

This option takes effect when compiling CUDA source files. They also take effect when compiling non-CUDA source files with irNVCC.

The macro __CUDA_ARCH_LIST__ is automatically defined by the compiler to contain the list of architectures specified on the command-line. The macro __CUDA_ARCH__ is automatically defined during device code compilation (unless combined_compilation is enabled).

 

language_cuda.additional_sys_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

System include paths for CUDA compilation. The entries in this option are effectively prepended to language_cxx.preprocessing.sys_include_path.

This option takes effect when compiling CUDA source files. They also take effect when compiling non-CUDA source files with irNVCC.

 

language_cuda.all_architectures : set[int] = {50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90}

Architecture IDs for which the device code should be compiled when -arch=all is used.

This option uses architecture numbers as they appear in the -arch command-line switch, for example compute_70 corresponds to 70.

Option -arch=all-major will use all architectures in this set that are a multiple of 10.

 

language_cuda.analysis_architectures : str = '$(CUDA_ANALYSIS_ARCH_LIST=)'

This option acts as a filter for the architectures for which device code is compiled.

If this option is an empty string, the filter will not be applied, so all architectures specified on the command-line will be used.

If this option is a comma-separated list of architecture names like compute_52, only the architectures that appear both in this list and on the command-line will be used. If this intersection of this option and the command-line architectures is empty, device code will not be compiled; only the host code will be analyzed.

 

language_cuda.combined_compilation : bool = False

If enabled, our compiler will compile both the host and device code in a single step. The __CUDA_ARCH__ macro will not be defined automatically in this mode.

If enabled, the resulting IR will contain only a single copy of __host__ __device__ functions. If disabled, such functions will be duplicated in the IR (with each device having an independent copy).

This option speeds up the compilation and analysis of CUDA code, at the cost of incorrectly handling functions containing #if __CUDA_ARCH__ preprocessor conditions.

If this option is enabled, all the device selecting switches (like e.g. -arch) are ignored.

 

language_cuda.cuda_preincludes : list[bauhaus.analysis.config.LayerRelativePath] = ['$(builtin:AXIVION_INSTALLDIR)/profiles/cuda/axivion_preinc.h']

Files to include automatically at the beginning of every compilation unit, directly after those in the language-independent preincludes option.

This option is used to specify the path to the Axivion-provided cuda/axivion_preinc.h file, which is required for CUDA compilation.

This option takes effect only when compiling CUDA source files, and not when using irNVCC on C or C++ files.

 

language_cuda.native_architectures : set[int] = {52}

Architecture IDs for which the device code should be compiled when -arch=native is used.

This option uses architecture numbers as they appear in the -arch command-line switch, for example compute_52 corresponds to 52.

This is also the set of architectures that will be used by default if -arch is not specified.

 

language_cuda.native_compiler : str | None = None

Executable to invoke when calling the native CUDA compiler tool.

This option is used by the irNVCC tool when performing a native build combined with the Axivion build.

 

language_cxx

Configuration that applies when compiling C++ code.
 

language_cxx.default_options : list[str] = []

Options being prepended to the Axivion compiler (cafe) call.
 

language_cxx.emulated_compiler : EmulationMode = 'None'

Enabling an emulation mode has wide-ranging effects:
  • activates support for vendor-specific language extensions
  • sets some predefined macros
  • emulates some compiler bugs
This corresponds to the --microsoft, --gcc / --g++ and --clang command-line switches.
 

language_cxx.emulated_compiler_version : int | None = None

The version of the compiler to emulate.

Examples:

  • --gnu_version=48010 emulates GCC 4.8.1
  • --gnu_version=100200 emulates GCC 10.2
  • --clang_version=100000 emulates Clang 10.0
  • --microsoft_version=1903 emulates Visual Studio 2015 Update 3
  • --microsoft_version=1916 emulates Visual Studio 2017 Update 9
  • --microsoft_version=1929 emulates Visual Studio 2019 Update 11
If this option is not specified, cafeCC will attempt to automatically detect it using the advanced.compiler_version_guessing logic (if any). Otherwise it defaults to the latest version of the emulated compiler that is supported by Axivion.

Note that our MSBuild integration will pass the --microsoft_version switch on the command-line, and thus overrides this configuration setting.

For gcc, this option should be configured to (10000 * __GNUC__) + (100 * __GNUC_MINOR__) + (__GNUC_PATCHLEVEL__).
For Clang, this option should be configured to (10000 * __clang_major__) + (100 * __clang_minor__) + (__clang_patchlevel__).
For MSVC, this option should be configured to the value of _MSC_VER. You can find a table of Visual Studio versions in the Microsoft documentation for _MSC_VER .

 

language_cxx.features

Provides fine-control for individual language features. These options allow enabling language constructs outside the mode where they would normally be enabled.

For example, the C11 _Generic feature could be activated in C++ mode.

All options in this group can be overwritten by the corresponding command-line options.

 

language_cxx.features.alternative_tokens : bool | None = None

Enables recognition of digraphs and (in C++) operator keywords.
int main(int argc, char** argv) <%
    if (1 < argc and argc < 10);
%>

In C mode, this option only controls the recognition of digraphs. The keywords are instead handled as macros in iso686.h.

If this option is not specified, it defaults to the behavior of the emulated compiler.

Corresponds to the --alternative_tokens / --no_alternative_tokens command-line option.

 

language_cxx.features.at_as_letter : bool = False

Enables support for character at (@) inside identifiers or keywords, such as @near.

Corresponds to the --at_as_letter command-line option.

 

language_cxx.features.at_operator : bool = False

Enables support for the int variable @ address; syntax.

Corresponds to the --at_operator command-line option.

 

language_cxx.features.binary_literals : bool | None = None

Controls support for binary literals (0b01010).

If not specified, binary literals are enabled in C++11 mode, Microsoft mode version≥1900, and GNU mode version≥40300.

Corresponds to the --binary_literals / --no_binary_literals command-line options.

 

language_cxx.features.c11_atomic : bool = False

Enables support for C11 _Atomic outside of C11 mode.

Corresponds to the --c11_atomic command-line option.

 

language_cxx.features.c11_generic : bool = False

Enables support for C11 _Generic outside of C11 mode.

Corresponds to the --c11_generic command-line option.

 

language_cxx.features.c99_complex : bool = False

Enables support for C99 _Complex and _Imaginary.

In GNU/Clang mode, this option enables _Imaginary and changes the type of __I__ from _Complex float to _Imaginary float. In standard C99 mode, this option has no effect. In other modes, this option can be used to enable C99 complex numbers without enabling all of C99 mode.

Corresponds to the --c99_complex command-line option.

 

language_cxx.features.c99_inline : bool = False

Enables support for C99 inline outside of C99 mode.

Corresponds to the --inline command-line option.

 

language_cxx.features.c99_restrict : bool = False

Enables support for C99 restrict outside of C99 mode.

Corresponds to the --restrict command-line option.

 

language_cxx.features.clang_feature_test_macros : bool = False

If enabled, the following Clang-style feature test macros are available (also in non-Clang modes): __has_feature, __has_extension, __has_attribute, __has_builtin, __has_include_next, and __is_identifier.

Corresponds to the --clang_feature_test_macros command-line option.

 

language_cxx.features.designated_initializers : bool | None = None

Controls support for designated initializers:
{ .a = 1, .b = 2 }
This feature is enabled automatically in C99 mode, C++20 mode, all GCC and Clang modes, and in Microsoft C mode version≥1800.

Corresponds to the --designators / --no_designators command-line options.

 

language_cxx.features.dollar_in_identifiers : bool = False

If enabled, allows the usage of dollar ($) characters in identifiers.

Corresponds to the --dollar command-line option.

 

language_cxx.features.exceptions : bool = True

Enable or disable support for exception handling.

Corresponds to the --exceptions / --no_exceptions command-line options.

 

language_cxx.features.flexible_array_members : bool = False

Enables support for C99-style flexible array members:
struct S {
    int len;
    int data[];
};
This feature is enabled automatically in C99, Microsoft, GCC and Clang modes. This option allows enabling the feature in other modes.

Corresponds to the --flexible_array_members command-line option.

 

language_cxx.features.gnu_attributes : bool = False

Enables support for GNU-style __attribute__((...)) outside of gcc mode.

Corresponds to the --gnu_attributes command-line option.

 

language_cxx.features.iar_floats : bool = False

Enable IAR-style float literals 0.NaN and 0.Infinity.

Corresponds to the --iar_floats command-line option.

 

language_cxx.features.ignore_std_namespace : bool = False

If enabled, namespace std is considered an alias of the global namespace: any symbol declared in namespace std will be available globally and vice versa.

Corresponds to the --ignore_std command-line option.

 

language_cxx.features.ignore_tokens : bool = False

Enables the following special keywords:
  • __ignore_next_token: The token after this token is skipped.
  • __ignore_till_semicolon: All tokens until the next semicolon are skipped.
  • __ignore_next_brackets: The next matching pair of brackets (braces, parentheses, etc.) including their content are skipped.
  • __ignore_next_brackets_or_till_semicolon: Behaves like __ignore_next_brackets except if a semicolon appears before the first opening bracket, in which case it behaves like __ignore_till_semicolon.
  • __ignore_init: An initialization following this token is skipped.
The typical use of these keywords is to ignore vendor-specific language constructs that are not supported by cafeCC. For example, consider the following code:
interrupt [42] void my_irq42_handler(void)
{
}
cafeCC does not support this interrupt construct. With #define interrupt __ignore_next_brackets, cafeCC will ignore the interrupt vector entry and successfully parse the function definition.

Corresponds to the --ignore_tokens command-line option.

 

language_cxx.features.includes_both_sys_and_nonsys : bool = False

Disables warnings if include directories are specified both as system include directory and non-system include directory. For some compiler and their build systems this is default and warnings thereof are undesired.

Corresponds to the --diag_suppress=incl_dir_both_sys_and_nonsys command-line option.

 

language_cxx.features.language_strictness

Type: LanguageStrictness

Default: 'default'

Enables strict ANSI/ISO mode, which provides diagnostic messages when nonstandard features are used, and disables features that conflict with ANSI/ISO C or C++. ANSI/ISO violations can be issued as either warnings or errors depending on the selected option.

Corresponds to the --strict_warnings and --strict command-line options.

 

language_cxx.features.no_errors_in_templates : bool = False

If enabled, compiler diagnostics (errors + warnings) detected in the generic form of templates will be suppressed. If the same error is still present during template instantiation, it will be reported at that point.

For example, this suppresses "use the typename keyword in a dependent context" errors. It also suppresses "undefined identifier" errors during the first phase of two-phase name lookup, but these are usually better addressed by parse_templates=defer.

Unlike option no_parse_templates, the generic form of templates will still be stored in the IR.

Corresponds to the --no_errors_in_templates command-line option.

 

language_cxx.features.parse_templates

Type: ParseTemplateMode

Default: 'automatic'

Controls when templates are parsed.

See documentation of the enumerator values for details.

 

language_cxx.features.runtime_type_information : bool = True

Enable or disable support for RTTI (runtime type information) features: dynamic_cast, typeid.

Corresponds to the --rtti / --no_rtti command-line options.

 

language_cxx.features.stdarg_builtin : bool | None = None

Enable or disable special treatment of the stdarg.h header.

When enabled, the stdarg.h and cstdarg headers are treated as builtins, i.e. our compiler will not read these system headers but instead use its own builtin definitions for the macros that should be defined there.

If unset, it is mode-dependent: It is enabled in all modes except GNU/Clang modes.

 

language_cxx.features.terse_static_assert : bool = False

If enabled, the C23 terse _Static_assert and the C++17 terse static_assert (i.e. one with only a single argument) are supported.

Corresponds to the --terse_static_assert command-line option.

 

language_cxx.features.trigraphs : bool = False

Enables recognition of trigraphs.
int main() ??< ??>

Trigraphs are not enabled by default in any compiler mode.

Corresponds to the --trigraphs / --no_trigraphs command-line option.

 

language_cxx.features.universal_asm : bool = False

Enables support for inline assembler syntax in various formats:
  • #pragma asm / #pragma endasm
  • #asm / #endasm
  • asm("nop")
  • asm volatile("RRX %0, %1" : "=r"(result) : "r" (value) );
  • __asm int 3
  • asm { mov al, 2; mov dx, 0xD007; out dx, al }
  • asm void f(void) { mov r0, #0 }
The asm and __asm keywords can be used interchangeably.

Corresponds to the --universal_asm command-line option.

 

language_cxx.features.unrecognize_pragma_pack : bool = False

Disables default recognition of #pragma pack(). This can be necessary if the original compiler uses #pragma pack but in a different syntactic way than what is typical for #pragma pack.

Corresponds to the --unrecognize_pragma=pack command-line option.

 

language_cxx.features.variable_length_arrays : bool | None = None

Controls support for C99 variable length arrays (VLA):
void test(int n) {
    int arr[n];
}

If not specified, VLAs are enabled in C99 mode and GNU mode.

Corresponds to the --vla / --no_vla command-line options.

 

language_cxx.features.variadic_macros

Type: VariadicMacros

Default: 'default'

Controls support for C99 variadic macros:
#define eprintf(...) fprintf (stderr, __VA_ARGS__)
And support for extended variadic macros:
#define eprintf(args...) fprintf(stderr, ## args)

If set to default, variadic macros are enabled in C99 mode, C++11 mode, GNU mode, and Microsoft mode version≥1400.

Corresponds to the --variadic_macros / --no_variadic_macros / --extended_variadic_macros / --no_extended_variadic_macros command-line options.

 

language_cxx.features.void_ptr_arithmetic : bool = False

If enabled, pointer arithmetic is also allowed on pointers to void.

Corresponds to the --void_ptr_arithmetic command-line option.

 

language_cxx.language_version

Type: CppLanguageVersion

Default: 'Cpp20'

Language version used by default (when not using a compiler switch like -std).
 

language_cxx.native_compiler : str | None = None

Executable to invoke when calling the native compiler tool.

This option is used by the irCC/irCXX tools when performing a native build combined with the Axivion build.

 

language_cxx.preprocessing

Options for preprocessing.
 

language_cxx.preprocessing.extension : str = 'ii'

Extension to use for preprocessed files.
 

language_cxx.preprocessing.external_preprocessor

Configuration of the external preprocessor being used when enabled.
 

language_cxx.preprocessing.external_preprocessor.command : str = 'g++'

External command to call for external preprocessing. The command must accept include paths with -I, macro definitions with -D and macro undefinitions with -U. The input file has to be the last argument on command-line and the preprocessed output has to go to stdout.
 

language_cxx.preprocessing.external_preprocessor.enabled : bool = False

Enable external preprocessor instead of internal one.
 

language_cxx.preprocessing.external_preprocessor.options : list[str] = ['-E']

Options to pass to the external preprocessor
 

language_cxx.preprocessing.external_preprocessor.response_file_format

Type: ResponseFileFormat

Default: 'argument_per_line'

Format to use when cafeCC writes options for the preprocessor to a response file. This must be set to the file format expected by the configured external preprocessor.
 

language_cxx.preprocessing.external_preprocessor.response_switch : str = '@'

Switch to use when passing options in a response file.
 

language_cxx.preprocessing.immutable_macros : set[str] = set()

Lists names of macros that cannot be modified. Any attempt to change the macro value via #define or #undef will be ignored.

If the macro has an initial value configured in predefined_macros, that value will be unchangeable within the whole compilation unit.

If the macro is not predefined, it will remain undefined in the whole compilation unit.

This option is equivalent to a use of #pragma immutable_macro at the beginning of the first preinclude file.

 

language_cxx.preprocessing.predefined_macros : dict[str, str] = {}

Allows predefining macros. Keys in this dictionary are the macro names. The values are the replacement texts that macro invocations are replaced with.

You can define function-like macros by including the parameter list in the dictionary key. Example: { "CONCAT(X, Y)": "X ## Y" }

Typically, this configuration option is filled by using a compiler setup script like gccsetup which extracts the predefined macros from the native compiler.

Note: some macros can be automatically predefined by the compiler frontend without being configured here.

__DATE__, __TIME__, __LINE__, __FILE__, __BASE_FILE__, __FILE_NAME__: Always automatically defined.
__COUNTER__, __TIMESTAMP__, __INCLUDE_LEVEL__: Always automatically defined.
__SIGNED_CHARS__: Defined iff the char type is signed.
__STDC__, __STDC_VERSION__, __STDC_HOSTED__: Defined according to selected C version.
__cplusplus: Defined according to selected C++ version
__cpp_*: WG21 SG10 SD-6 feature-test macros are automatically defined for features that are enabled in the current compiler mode.
__STDCPP_DEFAULT_NEW_ALIGNMENT__: Automatically defined in C++ modes where the "overaligned allocations" feature is enabled.
__AXIVION__, __AXIVION_VERSION__: Always automatically defined.
__EDG_SIZE_TYPE__, __EDG_PTRDIFF_TYPE__: Always automatically defined.

The values of the automatically predefined macros can be overridden using this configuration option.

 

language_cxx.preprocessing.sys_framework_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

System framework include search path (macOS specific).

The entries in this list will be passed to the preprocessor and compiler with --sys_framework_search_path=value.

Any header files found in the system framework include search path are considered system headers, and will be excluded from analysis by default.

 

language_cxx.preprocessing.sys_include_envvar : str | None = None

Name of environment variable that contains the system include search path. If an environment variable with this name exists, its value is split using the host-specific path separator and the resulting list is appended to the sys_include_path option.
 

language_cxx.preprocessing.sys_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

System include search path.

The entries in this list will be passed to the preprocessor and compiler with --sys_include=value.

Any header files found in the system include search path are considered system headers, and will be excluded from analysis by default.

 

language_cxx.preprocessing.user_framework_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

User framework include search path (macOS specific).

The entries in this list will be passed to the preprocessor and compiler with --framework_search_path value.

 

language_cxx.preprocessing.user_include_envvar : str | None = None

Name of environment variable that contains the user include search path. If an environment variable with this name exists, its value is split using the host-specific path separator and the resulting list is appended to the user_include_path option.
 

language_cxx.preprocessing.user_include_path : list[bauhaus.analysis.config.LayerRelativePath] = []

User include search path.

The entries in this list will be passed to the preprocessor and compiler with -I value.

 

language_cxx.preprocessing.vendor_predefined_macros : bool = True

This option defines whether vendor-specific predefined macros should be automatically set (the default) when operating in a respective emulated_compiler mode (e.g. GNU, Clang, or Microsoft), or not.

The affected macros are:

__GNUC__, __GNUG__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__, __VERSION__, __GXX_RTTI, __GNUC_STDC_INLINE__, __GNUC_GNU_INLINE__, __CHAR16_TYPE__, __CHAR32_TYPE__ in GNU emulation mode.
__clang__, __clang_major__, __clang_minor__, __clang_patchlevel__, __clang_version__ in Clang emulation mode.
__STRICT_ANSI__: Defined when the compiler is invoked in a strict ISO C or ISO C++ conforming mode, e.g. with the switch -std=c*.
__GXX_EXPERIMENTAL_CXX0X__ in GNU and Clang emulation modes if using C++11 or newer.
__GLIBCXX_BITSIZE_INT_N_0 and __GLIBCXX_TYPE_INT_N_0 in -std=gnu++* modes.
_MSC_VER, _MSC_FULL_VER, _MSC_BUILD, _MSC_EXTENSIONS, _WIN32, _M_IX86, _MSVC_LANG, _MSVC_TRADITIONAL, _MSVC_EXECUTION_CHARACTER_SET in Microsoft emulation mode.
_WIN64, _M_AMD64, _M_X64 additionally in 64-bit Microsoft emulation mode.

 

limits

Translation limits of the native compiler for use in certain stylechecks like MisraC2012-1.1. These limits do not influence the Axivion compiler.
 

limits.access_control : int | None = 4096

Maximum number of access control declarations in a class. None means 'unlimited'.
 

limits.at_quick_exit_functions : int | None = 32

Maximum number of functions registered by at_quit_exit(). None means 'unlimited'.
 

limits.atexit_functions : int | None = 32

Maximum number of functions registered by atexit(). None means 'unlimited'.
 

limits.base_classes : int | None = 16384

Maximum number of direct and indirect base classes. None means 'unlimited'.
 

limits.call_arguments : int | None = 256

Maximum number of arguments in a function call. None means 'unlimited'.
 

limits.catch_handlers : int | None = 256

Maximum number of handlers per try block. None means 'unlimited'.
 

limits.chars_in_line : int | None = 65536

Maximum number of characters in a line. None means 'unlimited'.
 

limits.chars_in_string : int | None = 65536

Maximum number of characters in a string literal. None means 'unlimited'.
 

limits.clauses_braced_init_list : int | None = 16384

Maximum number of initializer-clauses in one braced-init-list.
 

limits.cpp_members : int | None = 4096

Maximum number of all members (not just data members) in a class. None means 'unlimited'.
 

limits.data_members : int | None = 16384

Maximum number of members in a class, struct or union. None means 'unlimited'.
 

limits.direct_bases : int | None = 1024

Maximum number of direct base classes for a single class. None means 'unlimited'.
 

limits.enumerators : int | None = 4096

Maximum number of enumeration constants in an enum type. None means 'unlimited'.
 

limits.expr_in_core_constant : int | None = 1048576

Maximum number of full expressions evaluated within a core constant expression. None means 'unlimited'.
 

limits.external_identifiers : int | None = 65536

Maximum number of external identifiers in a unit. None means 'unlimited'.
 

limits.final_virtual_functions : int | None = 16384

Maximum number of final overriding virtual functions in a class. None means 'unlimited'.
 

limits.friends : int | None = 4096

Maximum number of friend declarations in a class. None means 'unlimited'.
 

limits.function_parameters : int | None = 256

Maximum number of parameters in a function definition. None means 'unlimited'.
 

limits.lambda_captures : int | None = 256

Maximum number of lambda-captures in one lambda-expression.
 

limits.macro_arguments : int | None = 256

Maximum number of parameters in a macro invocation. None means 'unlimited'.
 

limits.macro_parameters : int | None = 256

Maximum number of parameters in a macro definition. None means 'unlimited'.
 

limits.macros : int | None = 65536

Maximum number of macro definitions in a translation unit. None means 'unlimited'.
 

limits.member_initializers : int | None = 6144

Maximum number of member initializers in a constructor definition. None means 'unlimited'.
 

limits.nested_blocks : int | None = 256

Maximum nesting levels. None means 'unlimited'.
 

limits.nested_composites : int | None = 256

Maximum nesting levels of classes, structs and unions. None means 'unlimited'.
 

limits.nested_declarators : int | None = 256

Maximum number of pointer, array, and function declarators in a declaration. None means 'unlimited'.
 

limits.nested_externals : int | None = 1024

Maximum number of nested external specifications. None means 'unlimited'.
 

limits.nested_includes : int | None = 256

Maximum nesting level for #includes. None means 'unlimited'.
 

limits.nested_preprocessor_ifs : int | None = 256

Maximum nesting levels for preprocessor #ifs. None means 'unlimited'.
 

limits.nested_template_instantiations : int | None = 1024

Maximum number of recursively nested template instantiations. None means 'unlimited'.
 

limits.object_size : int | None = 262144

Maximum number of bytes in an object. None means 'unlimited'.
 

limits.parenthesized_declarators : int | None = 256

Maximum number of declarators in parens within a full declarator. None means 'unlimited'.
 

limits.parenthesized_expressions : int | None = 256

Maximum number of expressions in parens within a full expression. None means 'unlimited'.
 

limits.placeholders : int | None = 10

Maximum number of placeholders. None means 'unlimited'.
 

limits.recursive_constexpr : int | None = 512

Maximum number of recursive constexpr function invocations. None means 'unlimited'.
 

limits.scope_qualifications : int | None = 256

Maximum number of scope qualifications of one identifier. None means 'unlimited'.
 

limits.significant_chars_external : int | None = 1024

Maximum number of significant initial characters for external identifiers. None means 'unlimited'.
 

limits.significant_chars_internal : int | None = 1024

Maximum number of significant initial characters for internal identifiers and macros. None means 'unlimited'.
 

limits.static_members : int | None = 1024

Maximum number of static members in a class. None means 'unlimited'.
 

limits.structured_bindings : int | None = 256

Maximum number of structured bindings introduced in one declaration. None means 'unlimited'.
 

limits.switch_cases : int | None = 16384

Maximum number of case labels in a switch statement. None means 'unlimited'.
 

limits.template_params : int | None = 1024

Maximum number of template parameters in a template declaration. None means 'unlimited'.
 

limits.throw_spec : int | None = 256

Maximum number of throw specifications on a single function declaration. None means 'unlimited'.
 

limits.variables_in_block : int | None = 1024

Maximum number of variables in a block. None means 'unlimited'.
 

limits.virtual_bases : int | None = 1024

Maximum number of direct and indirect virtual bases of a class. None means 'unlimited'.
 

linker

Configuration for the linker tool.
 

linker.advanced

Advanced options that control linking behaviour.
 

linker.advanced.disable_all_messages : bool = False

If enabled, sets all messages to "disabled", overriding whatever has been set up in the 'messages' option.
 

linker.advanced.ignore_input_files : set[bauhaus.analysis.config.FileGlobPattern] = set()

Do not consider files matching these patterns for linking. This allows special files to be excluded without having to change the build process.
 

linker.advanced.ignore_missing_files : set[bauhaus.analysis.config.FileGlobPattern] = {'/*', '[A-Za-z]:[\/]*'}

Globbing patterns where linking is ok even if files are missing.
 

linker.advanced.messages

Type: dict[LinkerMessage, LinkerSeverity]

Default:

{
   'Adding_Library': 'remark',
   'Basepath_Mismatch': 'warning',
   'Cannot_Open_Error': 'error',
   'Cannot_Open_Ignored': 'warning',
   'Cannot_Open_Warning': 'warning',
   'Class_Struct_Mismatch': 'warning',
   'Compiler_Mismatch': 'warning',
   'Cylic_PCH': 'error',
   'Different_Symbols': 'warning',
   'Empty_Linker_Result': 'warning',
   'Field_Offset_Mismatch': 'warning',
   'General_Field_Remark': 'remark',
   'General_Field_Warning': 'warning',
   'General_ODR_Violation': 'warning',
   'Implicit_Func_Decl_Return_Type_Mismatch': 'warning',
   'Missing_Main': 'warning',
   'Missing_PCH_Error': 'error',
   'Missing_PCH_Warning': 'warning',
   'Multiple_Definition': 'warning',
   'Multiple_Main': 'warning',
   'No_IR_File': 'warning',
   'ODR_Violation_In_Enumerators': 'warning',
   'ODR_Violation_In_Field_Types': 'remark',
   'ODR_Violation_In_Fields': 'warning',
   'Old_IR_File_Error': 'error',
   'Old_IR_File_Warning': 'warning',
   'PCH_Without_Clients': 'warning',
   'Reference_To_Library': 'remark',
   'Runtimelib_Archive': 'error',
   'Runtimelib_PCH': 'error',
   'Template_Specialization_Vs_Instance': 'warning',
   'Tolerated_Type_Difference': 'warning',
   'Type_Alignment_Mismatch': 'warning',
   'Type_Size_Mismatch': 'warning',
   'Unresolved_Declaration': 'disabled',
   'Unused_Archive_Member': 'warning',
   'Unused_Library': 'remark',
   'User_System_Include_Mismatch': 'warning'
}
Severity of messages. Value "disabled" disables a message. "remark" messages will only be printed in verbose mode. Stylecheck rules, e.g., GeneralPurpose-CompilerWarnings or GeneralPurpose-LinkerWarnings, allow compiler or linker messages to be filtered by severity and sent to the Dashboard, optionally with the severity set up here.
 

linker.advanced.remove_input_files : set[bauhaus.analysis.config.FileGlobPattern] = set()

Globbing patterns of files to remove after successful link step.
 

linker.default_options : list[str] = []

Options being prepended to the irlink call.
 

linker.include_unused : bool = False

This option controls whether objects files from within archives are to be linked in even if no symbol of them is referenced at the point of linking.

If this option is false, unreferenced code (at link time) will not be part of the resulting IR and will not be analyzed (and thus not even be reported as dead code).

This option corresponds to the --include_unused linker command-line option.

 

linker.library_path : list[bauhaus.analysis.config.LayerRelativePath] = []

Library search path for the linker.

Libraries will first be searched in the paths configured here, then in the paths from library_path_envvar, and finally in the paths from -L arguments on the compiler command line.

Note: Library search is a feature of the cafeCC compiler driver. When calling irlink directly, no search will be performed.

 

linker.library_path_envvar : str | None = 'LIBRARY_PATH'

Name of environment variable that contains the library search path for the linker.
 

linker.native_linker : str | None = None

Executable to invoke when calling the native linker tool.

This option is used by the irLD tool when performing a native build combined with the Axivion build.

If unset, then native_compiler from the language options of the selected compiler rule is used.

 

linker.native_objcopy : str | None = '$(OBJCOPY=)'

Executable to invoke when calling the native objcopy tool.

This option is used by the irOBJCOPY tool when performing a native build combined with the Axivion build.

 

linker.native_strip : str | None = '$(STRIP=)'

Executable to invoke when calling the native strip tool.

This option is used by the irSTRIP tool when performing a native build combined with the Axivion build.

 

linker.search_object_files_in_library_path : bool = False

Whether file names detected as object file names on the cafeCC command-line should be searched for in library paths. If false, such file names will always be interpreted relative to the current working directory.
 

preincludes

preincludes : list[bauhaus.analysis.config.LayerRelativePath] = []

Files to include automatically at the beginning of every compilation unit. Can be used to supply macro definitions or symbol declarations to make built-in symbols of the native compiler known to the Axivion analysis.

Note: these files will be treated similar to system headers. cafeCC will not report warnings, and analysis will by default exclude violations in the preinclude files.

This option corresponds to the --sys_preinclude command-line option. Use the normal --preinclude option on the command-line if the files should not be treated as system headers.

 

switches

Mapping of native compiler switches to Axivion compiler switches
 

switches.enable_slash_switches : bool = False

If enabled, command-line switches starting with a slash are considered equivalent to switches starting with a minus. For example, a command-line switch -I will match the switch mapping key /I and vice versa.
 

switches.list_delimiters : str = ','

Controls the delimiter(s) used when a single command-line argument can provide multiple values as a list.

This affects some actions available in the switch mapping, e.g. IncludeDirectoryList. The default switch mapping does not use any actions that make use of this setting.

 

switches.mapping

Type: dict[str, MappedSwitch]

Default:

{
   '--':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='EndOfOptions',
      parameter_mode='none'
   ),
   '--arg_c':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ArgumentForC',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--arg_c++':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ArgumentForCPlusPlus',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--change_dir':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ChangeDirectory',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--create_pch':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CreatePCHFile',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--create_reproducer_zip':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CreateReproducerZip',
      parameter_mode='none'
   ),
   '--dependency_preprocess_mode':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='DependencyPreprocessMode',
      parameter_mode='none'
   ),
   '--diag_error':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--diag_remark':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--diag_suppress':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--diag_warning':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--edg_version':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ShowEDGVersion',
      parameter_mode='none'
   ),
   '--exit_code':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ExitWithError',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--framework_search_path':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--help':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ShowUsage',
      parameter_mode='none'
   ),
   '--ignore_pch':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='IgnorePCH',
      parameter_mode='none'
   ),
   '--no_bodies_for_path':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '--no_code_gen':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='NoCodeGeneration',
      parameter_mode='none'
   ),
   '--no_preproc_only':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PreprocessModeIsInAdditionToCompile',
      parameter_mode='none'
   ),
   '--sys_framework_search_path':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--sys_include':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--type_system':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PassthroughCafe',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--use_pch':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='UsePCHFile',
      parameter_mode='mandatory_space_or_equal'
   ),
   '--version':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ShowVersionFullStdOut',
      parameter_mode='none'
   ),
   '-B':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='BasePath',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-D':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='DefineMacro',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-E':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='PreprocessMode',
      parameter_mode='none'
   ),
   '-I':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='IncludeDirectory',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-L':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='LibraryDirectory',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-U':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='UndefineMacro',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-aarg':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='AssemblerArgument',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-absolute_filenames':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='AbsoluteFilenames',
      parameter_mode='none'
   ),
   '-archive':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ArchiveMode',
      parameter_mode='none'
   ),
   '-basepath':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='BasePath',
      parameter_mode='mandatory_space_or_equal'
   ),
   '-c':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CompileMode',
      parameter_mode='none'
   ),
   '-carg':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CompilerArgument',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-config':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='Config',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-continue':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ContinueMode',
      parameter_mode='none'
   ),
   '-dry_run':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='DryRun',
      parameter_mode='none'
   ),
   '-echo':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='EchoCommands',
      parameter_mode='none'
   ),
   '-j':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ParallelCompile',
      parameter_mode='optional_immediate'
   ),
   '-keep_preprocessed':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='KeepPreprocessed',
      parameter_mode='none'
   ),
   '-l':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='LinkLibrary',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-lang-c':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CMode',
      parameter_mode='none'
   ),
   '-lang-c++':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CPlusPlusMode',
      parameter_mode='none'
   ),
   '-lang-c-as-c++':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CAsCPlusPlusMode',
      parameter_mode='none'
   ),
   '-larg':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='LinkerArgument',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-license':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='ShowLicense',
      parameter_mode='none'
   ),
   '-log':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='LogFile',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-n':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='OutputDirectory',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-no_absolute_filenames':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='RelativeFilenames',
      parameter_mode='none'
   ),
   '-nostdinc':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='NoStdInc',
      parameter_mode='none'
   ),
   '-nostdinc++':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='NoStdIncPlusPlus',
      parameter_mode='none'
   ),
   '-o':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='OutputFile',
      parameter_mode='mandatory_space_or_immediate'
   ),
   '-shared':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='SharedLinking',
      parameter_mode='none'
   ),
   '-touch_on_error':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='TouchOnError',
      parameter_mode='none'
   ),
   '-v':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='EchoCommands',
      parameter_mode='none'
   ),
   '-verbose':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='VerboseMode',
      parameter_mode='none'
   ),
   '-with_ir_suffix':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='WithIRSuffix',
      parameter_mode='optional_immediate'
   ),
   '@':    bauhaus.rules.axivion.ci.project.compiler_integration.compiler_profile.MappedSwitch(
      action='CompilerResponseFile',
      parameter_mode='mandatory_immediate'
   )
}
The switch mapping allows reconfiguring how cafeCC interprets command-line switches.
 

switches.passthrough_double_minus : bool = True

Whether unmapped switches starting with -- are passed through to the cafe compiler.

Setting this option is equivalent to creating a switch mapping "--": {"parameter_mode": "mandatory_immediate", action: "PassthroughCafe" }, except that it doesn't collide with the non-wildcard '--' switch (end-of-options).

 

switches.response_file_format

Type: ResponseFileFormat

Default: 'host'

Controls how cafeCC will tokenize when reading from response files.
 

switches.response_file_preprocessor : str | None = None

This option can be used to specify an external script for reading the contents of a response file. This can be used to support additional features (e.g. comments) within response files.

If enabled, cafeCC will run the specified command for each response file. The name of the response file will be appended as an argument to the command-line. cafeCC will then read the stdout of the command instead of the response file.

In this mode, the option response_file_format controls how cafeCC will tokenize the stdout produced by the preprocessor script.

 

target_platform

target_platform : TargetPlatform = 'none'

The target platform determines which platform-specific compiler builtin functions are pre-defined. It also impacts some platform-specific language features, for example ARM scalable and NEON vector types.

This option can be specified on the command line via one of the following switches:

  • --x86_64_builtins
  • --x86_32_builtins
  • --arm64_builtins
  • --arm32_builtins
  • --no_target_platform
 

types

Configuration of types (sizes, alignment).
 

types.char16_t_type

Type: BasicIntegerType | None

Default: None

Basic type to be used for char16_t.

This option controls the type used by the compiler for wide string literals (u"abc"). In C++ where char16_t is not a typedef but its own type, this option sets the size, alignment and signedness of that type to be equal to that of the chosen integer type.

If not specified, this option will default to the smallest unsigned type that has at least 16 bits.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.char32_t_type

Type: BasicIntegerType | None

Default: None

Basic type to be used for char32_t.

This option controls the type used by the compiler for wide string literals (U"abc"). In C++ where char32_t is not a typedef but its own type, this option sets the size, alignment and signedness of that type to be equal to that of the chosen integer type.

If not specified, this option will default to the smallest unsigned type that has at least 32 bits.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.char_bits : int = 8

Number of bits in a char. As all other type sizes are specified as multiples of sizeof(char), this setting influences the size-in-bits of all types.
 

types.char_unsigned : bool = False

If enabled, plain char is treated as unsigned (signed otherwise).

Corresponds to the --unsigned_chars command-line option.

 

types.double_type

Allows configuring the size and alignment of the type double.

For the purposes of compile-time calculations, type double is always treated as a IEEE "binary64" 64-bit floating-point type.

 

types.double_type.alignof : int = 8

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.double_type.sizeof : int = 8

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.float_type

Allows configuring the size and alignment of the type float.

For the purposes of compile-time calculations, type float is always treated as a IEEE "binary32" 32-bit floating-point type.

 

types.float_type.alignof : int = 4

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.float_type.sizeof : int = 4

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.int_type

Allows configuring the size and alignment of the types signed int and unsigned int.
 

types.int_type.alignof : int = 4

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.int_type.sizeof : int = 4

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.long_double_type

Allows configuring the size and alignment of the type long double.

For the purposes of compile-time calculations, type long double will be treated as an "extended precision" 80-bit floating-point type if the size is configured to be at least 80 bits. Otherwise, it will be treated as a IEEE "binary64" 64-bit floating-point type.

 

types.long_double_type.alignof : int = 16

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.long_double_type.sizeof : int = 16

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.long_long_type

Allows configuring the size and alignment of the types signed long long and unsigned long long.
 

types.long_long_type.alignof : int = 8

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.long_long_type.sizeof : int = 8

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.long_type

Allows configuring the size and alignment of the types signed long and unsigned long.
 

types.long_type.alignof : int = 8

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.long_type.sizeof : int = 8

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.named_address_spaces

Type: dict[str, NamedAddressSpace]

Default: {}

Allows configuration of embedded c named address spaces. This is a mapping from named address spaces to an optional address space config. Use 'default' to configure the generic address space. See NamedAddressSpace for more information. This mapping can contain a maximum of 15 named address spaces.
 

types.named_registers : dict[str, int] = {}

Allows configuration of embedded c named registers. This is a mapping from register name to register size. The size determines the upper bound for the size of a variable stored in the register. This mapping can contain a maximum of 15 named registers.
 

types.pointer_type

Allows configuring the size and alignment of pointer types.
 

types.pointer_type.alignof : int = 8

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.pointer_type.sizeof : int = 8

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.preferred_enum_base_type

Type: BasicIntegerType | None

Default: None

Base type for C enums and C++ enums that do not explicitly specify a base. Does not apply to scoped enums (C++ enum class).

If all enumerator values fit into the type configured here, the configured type will be used as underlying type for the enum. If this option is not set, or if the enumerator values do not fit the configured type, the underlying type is determined according to the emulated compiler and --short_enums switch.

Note that in gcc mode, the enum base type will be always treated as unsigned if the enum has no negative enumerators.

 

types.ptrdiff_t_type

Type: SignedBasicIntegerType | None

Default: None

Basic type to be used for ptrdiff_t.

This option controls the type produced when subtracting two pointers.

If not specified, this option will default to the signed equivalent to size_t_type.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.short_enums : bool | None = None

Enable or disable a mode in which all enumeration types are "packed" (meaning that the underlying type of the enumeration is chosen to be the smallest integer that will accommodate the enumerator constants).

Corresponds to the --short_enums / --no_short_enums command-line option.

 

types.short_type

Allows configuring the size and alignment of the types signed short and unsigned short.
 

types.short_type.alignof : int = 2

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

types.short_type.sizeof : int = 2

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

types.size_t_type

Type: UnsignedBasicIntegerType | None

Default: None

Basic type to be used for size_t.

This option controls the type of sizeof() expressions. It is also the type that the C++ compiler expects in the signature of "operator new" implementations.

If not specified, this option will default to the smallest unsigned type that can fit the size of an object pointer.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.ssize_t_type

Type: SignedBasicIntegerType | None

Default: None

Basic type to be used for ssize_t.

The compiler uses this only for the compiler warnings when validating printf/scanf format strings.

If not specified, this option will default to the signed equivalent to size_t_type.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.wchar_t_type

Type: BasicIntegerType | None

Default: None

Basic type to be used for wchar_t.

This option controls the type used by the compiler for wide string literals (L"abc"). In C++ where wchar_t is not a typedef but its own type, this option sets the size, alignment and signedness of that type to be equal to that of the chosen integer type.

If not specified, this option will default to the first type in the list long, int, long long, unsigned short, char which has the same size as wchar_t on the host system (16-bit on Windows, 32-bit otherwise).

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

types.wint_t_type

Type: BasicIntegerType | None

Default: None

Basic type to be used for wint_t.

The compiler uses this only for the compiler warnings when validating printf/scanf format strings.

If not specified, this option will default to wchar_t_type.

This type should be configured to the same basic integer type as the corresponding typedef in the system headers.

 

Option Types

These types are used by options listed above:

BasicIntegerType

An enumeration.
 
  • char

  • signed char

  • unsigned char

  • signed short

  • unsigned short

  • signed int

  • unsigned int

  • signed long

  • unsigned long

  • signed long long

  • unsigned long long

CLanguageVersion

An enumeration.
 

Default

Automatically pick appropriate default language version for the emulated compiler.

C90

ANSI X3.159-1989 / ISO/IEC 9899:1990.

C99

ISO/IEC 9899:1999.

C11

ISO/IEC 9899:2011.

C18

ISO/IEC 9899:2018.

C23

ISO/IEC 9899:2024.

CompilerDriverAction

This enumeration is used in the switch mapping (switches.mapping option) to define how a command-line switch is handled by the compiler driver. See also: MappedSwitch.action.
 

IgnoreSwitch

The command-line switch is silently ignored (not mapped to anything).

UnknownSwitch

Handle the switch as an unknown switch: ignore the switch while printing a warning.

InputFile

An input file for the compiler or linker. The type of file will be detected based on the file extension.

Argument

The command-line switch is replaced with its parameter, which is then treated as if it was a command-line argument.

E.g. mapping "--file": { "parameter_mode": "mandatory_space_or_equal", action: "Argument" } results in the switch --file=file.c being replaced with file.c.

The difference to InputFile is that the resulting argument after the replacement can be another switch and doesn't have to be a file name. Note: unlike CompilerArgument (`-carg`), the switch mapping will be applied to the argument.

ArgumentList

The command-line switch is replaced with its parameter. The parameter is split using the option switches.list_delimiters, and the resulting elements are treated as if they were additional command-line arguments.

E.g. mapping "--args": { "parameter_mode": "mandatory_space_or_equal", action: "ArgumentList" } results in the switch --args=a.c,-o,a.o being replaced with the three arguments a.c -o a.o. Note: the switch mapping will be applied to these arguments.

ArgumentListSplitCmdline

The command-line switch is replaced with its parameter. The parameter is split using rules for the host operating system, and the resulting elements are treated as if they were additional command-line arguments.

E.g. mapping "--args": { "parameter_mode": "mandatory_space_or_equal", action: "ArgumentListSplitCmdline" } results in the switch --args="a.c -o a.o" being replaced with the three arguments a.c -o a.o. Note: the switch mapping will be applied to these arguments.

ArgumentForC

The command-line switch is replaced with its parameter. This parameter is processed again using the switch mapping, but the resulting action is restricted to apply only to C source files.

E.g. mapping "--arg_c": { "parameter_mode": "mandatory_space_or_equal", action: "ArgumentForC" } results in the switch --arg_c=-Iheaders_for_c being replaced with -Iheaders_for_c, which adds the directory headers_for_c to the include search path. However, unlike the plain -I switch, this change to the search path applies only to C units; the switch will instead be ignored for C++ units.

This action can only be combined with actions that modify the command-line of the underlying compiler. Use with other actions (e.g. --arg_c=-xc++) or with source files (e.g. --arg_c=test.c) will result in an error.

ArgumentForCPlusPlus

The command-line switch is replaced with its parameter. This parameter is processed again using the switch mapping, but the resulting action is restricted to apply only to C++ source files (including C++ variants like C++/CLI or CUDA).

E.g. mapping "--arg_c++": { "parameter_mode": "mandatory_space_or_equal", action: "ArgumentForCPlusPlus" } results in the switch --arg_c++=-Iheaders_for_c++ being replaced with -Iheaders_for_c++, which adds the directory headers_for_c++ to the include search path. However, unlike the plain -I switch, this change to the search path applies only to C++ units; the switch will instead be ignored for C units.

This action can only be combined with actions that modify the command-line of the underlying compiler. Use with other actions (e.g. --arg_c=-xc++) or with source files (e.g. --arg_c=test.c) will result in an error.

Config

Compatibility switch that allows setting a some commonly-used options based on the old XML configuration option path:
  • /cafeCC/Frontend/Object_File_Extension
  • /cafeCC/Switch_Configuration/Tokenize_Response_File

This option is deprecated. Consider instead using a JSON configuration layer to set options.

ShowUsage

If a switch mapped to this action is given, the compiler will show usage information (--help) on stderr.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

VerboseMode

Enables additional debug output.

ShowVersionFullStdOut

If a switch mapped to this action is given, the compiler will show its version number (--version) on stdout. This will be the full version output including build date and copyright information.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ShowVersionFullStdErr

If a switch mapped to this action is given, the compiler will show its version number (--version) on stderr. This will be the full version output including build date and copyright information.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ShowVersionShortStdOut

If a switch mapped to this action is given, the compiler will show its short version number (-dumpversion) on stdout.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ShowVersionShortStdErr

If a switch mapped to this action is given, the compiler will show its short version number (-dumpversion) on stderr.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ShowEDGVersion

Print version information for the C/C++ compiler frontend.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ShowLicense

Print license information.

The compiler will ignore all other command-line switches and exit with code 0 without compiling anything.

ExitWithError

Abort execution and return with exit code given as parameter (defaults to 1).

ObjectFileExtension

Use the parameter of the switch as extension for the object file (i.e. overwrite the configured object_file_extension), if the output filename of the object is not explicitly specified anyway.

OutputFile

Use the parameter of the switch as output file name.

When compiling a single compilation unit, this is the name of the output object file (IR). When linking/archiving, this is the name of the resulting IR or archive.

If this option is not given, the compiler will automatically determine the output file name(s) and write the output to the OutputDirectory. For object files, the file name will be the base name of the primary source file, combined with the configured object_file_extension. When linking, the default file name is a.out. When archiving, the OutputFile option is required.

OutputDirectory

Use the parameter of the switch as output directory.

This option only has an effect if OutputFile is not used. If no output directory is given, the compiler will write the output to the current working directory.

SecondaryOutputFile

Create an additional hardlink to the OutputFile using the specified file name.

CompilerResponseFile

Read additional switches from the specified response file.

The switches.response_file_format setting controls how the contents of response files are interpreted.

DryRun

If this switch is specified, cafeCC will not run the compiler/linker/etc., but instead will just output the command-line(s) it would use to run those tools.

EchoCommands

Show command line of process and child processes.

LogFile

Log command line of child processes to specified file.

Same as EchoCommands, but output goes to a file instead of stdout.

CompileMode

Enable compilation mode (-c): compile into separate object files, but don't link. This switch will override the configured default_mode.

PreprocessMode

Enable preprocessor-only mode (-E). This switch will override the configured default_mode.

LinkMode

Enable link mode. This switch will override the configured default_mode.

Whether linking uses the semantics of linking an executable or shared library depends on the SharedLinking/ExecutableLinking switches.

ArchiveMode

Enable archive mode (-archive). Create static library. This switch will override the configured default_mode.

ArchiveModeWithOutputFile

Enable archive mode (-archive). Create static library. This switch will override the configured default_mode.

Additionally, the parameter to this switch is treated as the name of the output static archive.

This combines ArchiveMode and OutputFile into a single switch.

ParallelCompile

If this switch is specified, cafeCC will compile multiple compilation units in parallel. If a parameter is specified for this switch, that parameter must be an integer and is interpreted as the maximum parallelism. If no parameter is specified, cafeCC will use the number of logical CPU cores, capped to reserve enough memory per core.

ContinueMode

Keep going in case of an error.

TouchOnError

Touch the output file(s) on error.

TouchFile

Touch the file named in the parameter of this switch.

CompilerArgument

Pass on parameter to the compiler backend.

The parameter is only forwarded when compiling, not in preprocessing mode.

Example: -carg --signed_chars will pass --signed_chars to the compiler.

PassthroughCafe

Pass the whole switch and its parameter to the compiler backend.

The switch is forwarded when compiling and when preprocessing.

Example: a switch mapping entry { '--diag_suppress': {"parameter_mode": "mandatory_space_or_equal", action: "PassthroughCafe" } will forward the --diag_suppress switch and its parameter to the compiler.

Note that all unknown switches starting with '--' are automatically forwarded to the compiler (see option switches.passthrough_double_minus), so this action is mainly useful for options that take a parameter.

AssemblerArgument

Pass on parameter to the giraffe assembler faking front end.

LinkerArgument

Pass on parameter to the linker backend.

AllowEmptyInput

Allow running cafeCC with no input files.

gcc normally requires at least one input file, but makes an exception if the -Wl switch is used. This action allows cafeCC to emulate this behavior.

IncludeDirectory

Add argument to the normal include search path.

IncludeDirectoryList

Add list of delimiter-separated directories to normal include search path.

The delimiters can be specified with the option switches.list_delimiters.

IncludeDirectoryRecursively

Add specified directory and all of its sub-directories to normal include search path.

IncludeDirectoryEarlyOnlyQuoted

Add parameter to the early include search path, which is only searched for quoted #include "header.h" and not for #include <header.h>.

Directories specified with this option are searched before the normal include directories.

This corresponds to the gcc -iquote option.

SystemHeadersEarly

Add parameter to the system include search path.

Directories specified with this option are searched after the normal include directories, but before the sys_include_path from the compiler configuration.

Any header files found in the system include search path are considered system headers. By default, no violations will be reported in these headers (see option exclude_messages_in_system_headers on stylecheck rules).

This corresponds to the gcc -isystem option.

SystemHeadersLate

Add parameter to the system include search path.

Directories specified with this option are searched after the sys_include_path from the compiler configuration.

Any header files found in the system include search path are considered system headers. By default, no violations will be reported in these headers (see option exclude_messages_in_system_headers on stylecheck rules).

This corresponds to the gcc -idirafter option.

FrameworkDirectory

Add parameter to the normal include search path as a MacOS framework directory.

This corresponds to the gcc -F option.

FrameworkSystemDirectoryEarly

Add parameter to the system include search path as a MacOS framework directory.

Directories specified with this option are searched after the normal include directories, but before the sys_include_path from the compiler configuration.

Any header files found in the system include search path are considered system headers. By default, no violations will be reported in these headers (see option exclude_messages_in_system_headers on stylecheck rules).

This corresponds to the gcc -iframework option.

FrameworkSystemDirectoryLate

Add parameter to the system include search path as a MacOS framework directory.

Directories specified with this option are searched after the sys_include_path from the compiler configuration.

Any header files found in the system include search path are considered system headers. By default, no violations will be reported in these headers (see option exclude_messages_in_system_headers on stylecheck rules).

LibraryDirectory

Add parameter to the library search path.

This corresponds to the gcc -L option.

LinkLibrary

Link against a library. -lz will look for libz.so or libz.a in the library search path.

This corresponds to the gcc -l option.

See also: options library_path and library_search_extensions in the linker rule.

BasePath

Set source base path.

The IR will store file names relative to this base path. This must match the /Project/directory configuration, as the CI expects file names to be stored relative to the project root directory.

If the base path is not specified on the command line, cafeCC will use the environment variable CAFECC_BASEPATH. Note that axivion_ci automatically sets CAFECC_BASEPATH to the /Project/directory.

The base path should only be specified explicitly when building an IR outside of axivion_ci.

DefineMacro

Set preprocessor macro.

DefineMacroList

Add list of delimiter-separated preprocessor macros.

The delimiters can be specified with the option switches.list_delimiters.

UndefineMacro

Unset preprocessor macro.

UndefineMacroList

Add list of delimiter-separated preprocessor macro undefines.

The delimiters can be specified with the option switches.list_delimiters.

PreincludeFile

Additional file to include at the beginning of every compilation unit.

Can be used to supply macro definitions or symbol declarations to make built-in symbols of the native compiler known to the Axivion analysis.

PreincludeFileList

Additional files to include at the beginning of every compilation unit.

Can be used to supply macro definitions or symbol declarations to make built-in symbols of the native compiler known to the Axivion analysis.

The delimiters can be specified with the option switches.list_delimiters.

PreincludeMacros

Additional file to include at the beginning of every compilation unit.

The file is only read by the preprocessor for the purpose of defining macros; it cannot declare other symbols.

PreincludeMacros are processed before PreincludeFile.

SysRoot

Set the sysroot prefix (--sysroot). If an include directory or library search directory is specified on the command-line starting with '=' or '$SYSROOT', the '=' or '$SYSROOT' is replaced with the sysroot prefix.

HeaderSysRoot

Set the sysroot prefix for includes (-isysroot). If an include directory is specified on the command-line starting with '=' or '$SYSROOT', the '=' or '$SYSROOT' is replaced with the sysroot prefix.

CompileLanguage

Specify source language (c, c++, assembler) for all following source files.

CMode

Specify source language as C. All input files after this switch on the command-line will be compiled as C. Language-detection based on file extension will be disabled.

CPlusPlusMode

Specify source language as C++. All input files after this switch on the command-line will be compiled as C++. Language-detection based on file extension will be disabled.

AssemblerMode

Specify source language as Assembler. All input files after this switch on the command-line will be treated as assembler. Language-detection based on file extension will be disabled.

CAsCPlusPlusMode

Compile input files auto-detected as C in C++ mode. Language-detection based on file extension remains enabled: unlike CPlusPlusMode, unknown files will continue being treated as object files.

CudaMode

Specify source language as CUDA. All input files after this switch on the command-line will be compiled as CUDA. Language-detection based on file extension will be disabled.

CSourceFile

Compile parameter as C source file.

CPlusPlusSourceFile

Compile parameter as C++ source file.

AssemblerSourceFile

Compile parameter as Assembler source file.

CudaSourceFile

Compile parameter as CUDA source file.

NvccMode

Emulate the behavior of the NVIDIA CUDA compiler nvcc.

This switch will enable the following options, even for non-CUDA code:

  • language_cuda.additional_predefined_macros
  • language_cuda.additional_sys_include_path
  • language_cuda.additional_library_path

In CUDA mode (.cu source files), this mode is enabled implicitly. Tool irNVCC uses the --nvcc commandline switch to enable this mode.

This switch has no impact on language detection.

CudaArchitecture

Specify the CUDA architecture. Used for the nvcc -arch switch.

CudaGenerateCode

Specify CUDA architecture/code tuples. Used for the nvcc -gencode switch.

CudaHost

Enable CUDA mode, but compile only the host code. Corresponds to the cafe --cuda_host switch.

CudaDevice

Enable CUDA mode, but compile only the device code. Takes the CUDA architecture number as parameter. Corresponds to the cafe --cuda_device switch.

SharedLinking

Use the semantics of linking a shared library (.so / .dll / .dylib). In this mode, the linker will keep unreferenced units.

This option only has an effect in linking mode.

ExecutableLinking

Link as executable. The linker will expect a main function and may discard unneeded units inside static archives.

This is the default when SharedLinking is not specified. ExecutableLinking overrides a previous SharedLinking switch.

This option only has an effect in linking mode.

NoStdInc

Do not use the include directories specified in the compiler configuration or environment variables for C standard headers. Only use the include directories specified on the command-line.

NoStdIncPlusPlus

Do not use the include directories specified in the compiler configuration or environment variables for C++ standard headers. C standard headers are still being used unless also a switch that maps to NoStdInc is present on the command-line, in which case only the include directories that are specified on the command-line are used.

AllWarnings

Display lots of warnings (default).

ExtraWarnings

Display even more remarks.

NoWarnings

Do not display compiler/linker warnings and remarks.

PreprocessWithComments

Preserve comments when preprocessing.

PreprocessWithoutLine

Do not emit #line directives when preprocessing.

TraceIncludes

Trace includes. The names of included files will be written to stderr.

TraceIncludesStdout

Trace includes. The names of included files will be written to stdout.

TraceIncludesMSVC

Trace includes in MSVC format. The names of included files will be written to stdout, with each line prefixed by Note: including file:. If preprocessor mode is enabled, the output will instead be written to stderr.

KeepPreprocessed

Keep or generate the preprocessed code.

When using an external preprocessor, do not delete the preprocessed code (.i / .ii file). When not using an external preprocessor, emit preprocessed code into .i/.ii file in addition to the normal compilation step.

CreateReproducerZip

Create a file ".reproducer.zip" next to the output object file. This zip will contain all files necessary to reproduce the compiler invocation:
  • The primary source file
  • Included header files
  • Full preprocessed source code (.i/.ii file)
  • The compiler configuration (.json files)
  • The command line used when calling the compiler
This is useful as it allows axivion support to reproduce compiler issues without the full codebase and build system.
Even if this option is not in use, such a zip file will also be automatically generated when our compiler crashes with an internal error.

ShowResolvedArchive

If specified on command-line, resolve an archive file name. The output will be written to stdout. cafeCC will then exit with code 0 without calling any compiler or linker. Other command-line arguments will be ignored (except for those influencing the library search path).

NoCodeGeneration

Run the compiler without writing an output IR file.

TemplateRecursionLimit

Set maximum recursion limit for template instantiations.

Corresponds to --pending_instantiations= switch for cafe.

DependencyFile

Specify the output file where dependencies are written by DependencyMode or DependencyPreprocessMode.

DependencyPreprocessMode

Activate preprocess mode, but instead of preprocessor output, print a make rule with dependencies on the included headers.

DependencyMode

When compiling, write a dependency file (*.d) next to the object file. The dependency file will contain a make rule with dependencies on the included headers.

DependencyTargetQuote

In DependencyMode or DependencyPreprocessMode, controls the name of the make target.

Special characters in the parameter will be quoted.

DependencyTarget

In DependencyMode or DependencyPreprocessMode, controls the name of the make target.

Special characters in the parameter will be emitted as-is.

PreprocessModeIsInAdditionToCompile

If this option is enabled (--no_preproc_only):

  • PreprocessMode (-E) will act like CompileMode except it will also output preprocessed code to stdout.
  • DependencyPreprocessMode (-M) will act like DependencyMode (-MD).
  • If neither PreprocessMode nor DependencyPreprocessMode are active, this option has no effect.

MetadataDirectory

Use directory to resolve .NET file references when compiling C++/CLI.

Corresponds to the /AI option of the Microsoft compiler.

ForcedUsing

Specify metadata file to reference.

Corresponds to the /FU option of the Microsoft compiler.

CreatePCH

Create precompiled header file.

Note that the PCHFile action must also be used when creating or using a PCH.

If a parameter is given, it specifies the name of the header that should be precompiled, as if #pragma hdrstop was placed after the include of that header.

Corresponds to the /Yc option of the Microsoft compiler.

UsePCH

Use precompiled header file.

Note that the PCHFile action must also be used when creating or using a PCH.

If a parameter is given, it specifies the name of the header that was precompiled, as if #pragma hdrstop was placed after the include of that header.

Corresponds to the /Yu option of the Microsoft compiler.

IgnorePCH

Do not create/use precompiled header file. This overwrites the effect of a previous CreatePCH/CreatePCHFile/UsePCH/UsePCHFile switch.

Corresponds to the /Y- option of the Microsoft compiler.

PCHFile

Set the filename for the precompiled header file.

This option alone does not enable creation/use of a precompiled header. In combination with CreatePCH, this specifies the file that should be written by the compiler. In combination with UsePCH, this specifies the file that should be read.

Corresponds to the /Fp option of the Microsoft compiler.

CreatePCHFile

Create precompiled header file.

Note: this corresponds to the EDG --create_pch option. For Microsoft compiler compatibility see CreatePCH.

UsePCHFile

Use precompiled header file.

Note: this corresponds to the EDG --use_pch option. For Microsoft compiler compatibility see UsePCH.

AbsoluteFilenames

Enable absolute file names in error/warning messages.

RelativeFilenames

Disable absolute file names in error/warning messages.

WithIRSuffix

Enable "with IR suffix" mode: implicitly append ".ir" to any object, archive or executable file names. This applies to object and archive files listed on the command-line when linking; to any library files found by library search, and to any output IR files written by the compiler/linker/archiver.

This mode allows calling cafeCC with the same command-line arguments as the native compiler, while using the same output directory. This is especially useful when using irCC for combined native compilation + Axivion analysis.

This mode is enabled automatically if the environment variable CAFECC_WITH_IR_SUFFIX exists.

ChangeDirectory

Make parameter the current working directory.

The directory is changed as soon as the switch is handled, so relative filenames are interpreted relative to that directory.

EndOfOptions

End of command-line options (--). All following command-line options will be interpreted as InputFile without applying any switch mapping.

CompilerMode

An enumeration.
 
In this mode, input files can be source files, static archives and object IR files. Sources will be compiled and then all inputs will be linked together into a single output IR.

Compile

In this mode, input files must be source files. The sources will be compiled into separate object files, as with gcc -c.

Preprocess

In this mode, input files must be source files. The sources will be preprocessed but not compiled, as with gcc -E.

Archive

The compiler will produce a static archive as output.

CppLanguageVersion

An enumeration.
 

Default

Automatically pick appropriate default language version for the emulated compiler.

If no emulation mode is active, the default will be C++03 with a few common language extensions that were later standardized in C++11:

  • Variadic Macros
  • _Pragma operator
  • extern template
  • friend type-name;

Cpp03

ISO/IEC 14882:2003

Cpp11

ISO/IEC 14882:2011

Cpp14

ISO/IEC 14882:2014

Cpp17

ISO/IEC 14882:2017

Cpp20

ISO/IEC 14882:2020

Cpp23

ISO/IEC 14882:2024

EmulationMode

An enumeration.
 

None

Disables all Clang, GNU, and Microsoft features.

GNU

Enables GNU C/C++ language compatibility features.

Corresponds to the --gcc / --g++ command-line option.

Microsoft

Enables Microsoft emulation mode.

Corresponds to the --microsoft command-line option.

Clang

Enables Clang C/C++ language compatibility features.

Corresponds to the --clang command-line option.

LanguageStrictness

An enumeration.
 

default

Enables nonstandard features and features conflicting with ANSI/ISO C or C++ if the otherwise selected language mode requires is (i.e. GNU mode or Microsoft mode).

warnings

Enable strict ANSI/ISO mode, provide warning messages when nonstandard features are used, and disables features that conflict with ANSI/ISO C or C++.

Corresponds to the --strict_warnings command-line option.

errors

Enable strict ANSI/ISO mode, provide error messages when nonstandard features are used, and disables features that conflict with ANSI/ISO C or C++.

Corresponds to the --strict command-line option.

LinkerMessage

An enumeration.
 
  • Adding_Library

  • Reference_To_Library

  • Cannot_Open_Error

  • Cannot_Open_Warning

  • Cannot_Open_Ignored

  • No_IR_File

  • Old_IR_File_Error

  • Old_IR_File_Warning

  • Cylic_PCH

  • Runtimelib_PCH

  • Runtimelib_Archive

  • Missing_PCH_Error

  • Missing_PCH_Warning

  • PCH_Without_Clients

  • Basepath_Mismatch

  • Compiler_Mismatch

  • General_ODR_Violation

  • ODR_Violation_In_Fields

  • ODR_Violation_In_Field_Types

  • Tolerated_Type_Difference

  • ODR_Violation_In_Enumerators

  • Implicit_Func_Decl_Return_Type_Mismatch

  • Type_Size_Mismatch

  • Type_Alignment_Mismatch

  • Field_Offset_Mismatch

  • Multiple_Definition

  • Unresolved_Declaration

  • General_Field_Remark

  • General_Field_Warning

  • Missing_Main

  • Multiple_Main

  • Template_Specialization_Vs_Instance

  • Class_Struct_Mismatch

  • Unused_Archive_Member

  • Unused_Library

  • Empty_Linker_Result

  • User_System_Include_Mismatch

  • Different_Symbols

LinkerSeverity

An enumeration.
 
  • disabled

  • progress

  • remark

  • warning

  • error

MappedSwitch

An entry in the switch mapping (switches.mapping option).

The key in the switch mapping dictionary is the switch name, e.g. -o. The value is an instance of this class.

 

action

Type: CompilerDriverAction | str

Default: 'IgnoreSwitch'

Action or replacement.

If an enum value is chosen, the switch is mapped to a built-in cafeCC action. The parameter (parsed as specified in the parameter_mode) will be provided to the action.

If a string value is chosen, the value is a replacement. If a switch matching this mapping is detected on the command-line, the detected switch (including its parameter, if any) will be replaced with the configured string.

The replacement value will be tokenized into (potentially) multiple command-line arguments using shell splitting logic according to the host operating system.
If the replacement value contains $1, the $1 is substituted with the parameter passed to the switch being replaced.
The resulting arguments will be processed further by applying the switch mapping to them.

 

parameter_mode : ParameterMode = 'none'

Controls how this switch will parse its parameter from the command-line.
 

NamedAddressSpace

Used in the types.named_address_spaces configuration option. The key in the dictionary is the name of the address space, and is registered as an implementation-defined keyword. With this dataclass, the properties of the address space can be configured.
 

parent : str | None = None

The name of an enclosing address space or 'default' for the generic address space or None for no enclosing address space.
 

pointer_type

The size and alignment of a pointer to this named address space.
 

pointer_type.alignof : int = 8

The alignment of the data type, in multiples of sizeof(char).

alignof must be a power of two.

 

pointer_type.sizeof : int = 8

The size of the data type, in multiples of sizeof(char).

sizeof must be a multiple of alignof.

 

ParameterMode

An enumeration.
 

none

The switch does not accept a parameter.

mandatory_space_or_immediate

The switch must have a parameter, which can be provided either appended directly to the switch name, or in the next command-line argument.

Example configuration:

{"-o": { action: OutputFile, parameter_mode: 'mandatory_space_or_immediate' }}
This will accept both "-ofilename" and "-o filename".

Corresponds to the : suffix in the old XML-based configuration.

mandatory_space_or_equal

The switch must have a parameter, which can be provided as part of the same switch when using an equals sign. Alternatively, the parameter can be provided in the next argument.

Example configuration:

{"--output": { action: OutputFile, parameter_mode: 'mandatory_space_or_equal' }}
This will accept both "--output=filename" and "--output filename".

Corresponds to the = suffix in the old XML-based configuration.

mandatory_immediate

The switch must have a parameter, which must be appended directly to the switch name. If no parameter is given, the parameter value is considered to be the empty string.

Example configuration:

{"@": { action: CompilerResponseFile, parameter_mode: 'mandatory_immediate' }}
This will accept "@filename".

Corresponds to the ! suffix in the old XML-based configuration.

optional_immediate

The switch can have a parameter. If present, the parameter must be appended directly to the switch name. If no parameter is given, the action is considered to have no parameter.

For some actions (e.g. ParallelCompile), the lack of a parameter causes the action to fall back to a default value. For actions that require a parameter, the lack of a parameter will be reported as a command-line error.

Example configuration:

{"-j": { action: ParallelCompile, parameter_mode: 'optional_immediate' }}
This will accept "-j" or "-j4".

Corresponds to the ? suffix in the old XML-based configuration.

ParseTemplateMode

An enumeration.
 

automatic

Automatically pick based on emulated_compiler. Defaults to "deferred" when emulating a Microsoft compiler in permissive mode (without /permissive-). Defaults to "standard" in all other cases.

standard

Standard C++ behavior: the generic form of templates is immediately parsed when the template is defined.

Corresponds to the --no_defer_parse_function_templates command-line option.

deferred

If enabled, parsing of function templates in their generic form is deferred until the first instantiation.

Any identifier that is declared after the function template and before the first instantiation will become visible to the function body. This is nonstandard behavior as overload resolution for non-dependent calls might pick different overloads than in standard C++.

For uninstantiated function templates, parsing will be deferred until the end of the translation unit. Additionally, any errors encountered during parsing of uninstantiated function templates will be suppressed.

This option is helpful for legacy code written for compilers that did not immediately parse templates at their definition (for example the Microsoft compiler without /permissive-). Unlike option never, information about the generic form of templates will be present in the IR.

Corresponds to the --defer_parse_function_templates command-line option.

never

Parsing of nonclass templates in their generic form (i.e., if they are not really instantiated) is skipped.

Use of this option is not recommended: if this option is enabled the IR will only contain concrete template instances, and not the generic form. Some analysis is only possible if the generic form is present, which may result in false negatives.
We recommend using the alternative option deferred instead, possibly in combination with no_errors_in_templates.

Corresponds to the --no_parse_templates command-line option.

ResponseFileFormat

An enumeration.
 

argument_per_line

The response file contains one argument per line. Empty lines are ignored. Other than newline, there are no special characters.

posix

Tokenize contents of response file similar to a POSIX shell: whitespace splits arguments unless quoted or escaped with \. Both double quotes (") and single quotes (') can be used. The interpretation of backslashes differs depending on the quoting style.

windows

Tokenize contents of response file with the Windows rules for argument splitting (like CommandLineToArgvW, except that newlines can also be used as argument separator). Double quotes (") must be used for arguments containing whitespace. Backslash is only an escape character when followed by double quotes.

host

Tokenize contents of response file with the Windows or POSIX rules, depending on the host system running the Axivion Suite.

backslash_always_escapes

Tokenize contents of response file: whitespace splits arguments unless quoted or escaped with \. Both double quotes (") and single quotes (') can be used. Unlike POSIX mode, backslash always acts as an escape character.

SignedBasicIntegerType

An enumeration.
 
  • signed char

  • signed short

  • signed int

  • signed long

  • signed long long

SourceFileEncoding

An enumeration.
 

Latin1

ISO-8859-1 aka. Latin-1

UTF8

UTF-8

TargetPlatform

An enumeration.
 

none

Platform-specific features and builtin functions are not available. Platform-independent builtin functions remain available (depending on the emulation_mode).

x86_32

32-bit version of Intel x86 platform.

x86_64

64-bit version of Intel x86 platform, also known as AMD64.

arm32

ARM32 platform.

arm64

ARM64 platform.

UnsignedBasicIntegerType

An enumeration.
 
  • unsigned char

  • unsigned short

  • unsigned int

  • unsigned long

  • unsigned long long

VariadicMacros

An enumeration.
 

default

Uses default behavior: variadic macros are enabled in C99 mode, C++11 mode, GNU mode, and Microsoft mode version≥1400.

disabled

Disables support for C99 and extended variadic macros.

enabled

Enables support for C99 variadic macros:
#define eprintf(...) fprintf (stderr, __VA_ARGS__)

extended

Enables support for extended variadic macros (in addition to the C99 variadic macros support):
#define eprintf(args...) fprintf(stderr, ## args)