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] =
Glob patterns for environment variables that should be captured and stored in the IR.{'*INCLUDE', '*PATH', '*ROOT', 'AXIVION_*', 'BAUHAUS_*', 'CAFE*', 'IRLINK_*'}
advanced.compiler_version_guessing : dict[bauhaus.analysis.config.SearchPattern, str] =
If the option{}language_*.emulated_compiler_versionis 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 pathC:\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
The default encoding that the compiler will use to read source files if theType: SourceFileEncoding
Default:
'UTF8'--unicode_source_kindswitch is not in use and the file does not have a byte-order mark.
advanced.filemap
Filename mapping where the key part is a regular expression and the value part the replacement. For example, the keyType: dict[typing.Pattern[str], str]
Default:
{ '/cygdrive/([A-Za-z])/(.*)': '$1:/$2' }^/cygdrive/([A-Za-z])/(.*)and the value$1:/$2map 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$Nplace-holders for the value of the capture group number N.
advanced.ignore_include_globbings : set[bauhaus.analysis.config.FileGlobPattern] =
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.set()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_globbingsoption: the compiler will still read the header, but avoid storing information about macro invocations or#ifdirectives in the IR.
advanced.ignore_translation_unit_globbings : set[bauhaus.analysis.config.FileGlobPattern] =
Every primary source file (set().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] =
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.{'main'}See also the configuration for additional entry points:
/Analysis/AnalysisControl/Environment/EntryPoints
advanced.no_macro_invocations_for_system_headers : bool =
If enabled, avoid storing macro invocations that occur within system headers. Additionally this option also avoids storing preprocessorTrue#ifconstructs.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=Falseon 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 (setno_macro_invocations_for_system_headers = False).
advanced.no_macros_for_path_globbings : set[bauhaus.analysis.config.FileGlobPattern] =
Every source file or header is checked against these patterns (with the filename relative to the base path (-B)). If the file matches,set()cafeCCwill avoid storing macro invocations and#ifconstructs 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_addressor the inputs for the search logic that looks for a free memory segment in the PCH-creating process.
advanced.pch.base : str =
Starting address for the search logic that finds a free memory segment.'0x000043a700000000'
advanced.pch.debug : bool =
Whether debugging output for PCHs should be activated.False
advanced.pch.fixed_address : str | 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 logicNone
advanced.pch.size : str =
Minimum size of the free memory region that will be accepted by the search logic.'0x0000000400000000'
advanced.pch.step : str =
Step size for the search logic that finds a free memory segment.'0x0000001000000000'
advanced.pch.stop : str =
Stop address for the search logic that finds a free memory segment.'0x00006FF000000000'
advanced.response_file_threshold : int =
Configures the maximum number of bytes that are passed from8000cafeCCto 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,
cafeARwill be called (llvm-arvariant shipping with Axivion Suite).
archiver.native_archiver : str | None =
Executable to invoke when calling the native archiver tool.'$(AR=)'This option is used by the
irARtool when performing a native build combined with the Axivion build.If unset, then whatever is configured as
commandis used also as native archiver tool.
archiver.native_lto_ranlib : str | None =
Executable to invoke when calling the native gcc-ranlib wrapper tool.NoneThis option is used by the
irLTORANLIBtool when performing a native build combined with the Axivion build.If unset, then
gcc-ranlibis used also as native archiver tool.
archiver.native_ranlib : str | None =
Executable to invoke when calling the native ranlib tool.'$(RANLIB=)'This option is used by the
irRANLIBtool when performing a native build combined with the Axivion build.If unset, then
ranlibis 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,
crwill be used (create output if missing, insert/replace into archive). Alternatively, to emulate different archiver behavior, you could e.g. usecqL(create output if missing, quick-append, flatten recursive archives), or even add letterTfor "thin archives".
archiver.response_file_format
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.Type: ResponseFileFormat
Default:
'backslash_always_escapes'
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 =
If enabled, enforce calls to the internal archiver toolFalsecafeARto create thin archives instead of normal ones when being called viacafeCCorirAR(it has no effect when callingcafeARdirectly, 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_unusedto better parallelize the linking step.
default_mode¶
default_mode : CompilerMode = 'Link'
A typical switches.mapping will define the following switches
to change the mode:
-c: Compile-E: Preprocess-archive: Archive
environment¶
environment : dict[str, str] = {}
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,cafeCCwill automatically run an external program on the resulting IR file after compiling or linking.
external_postprocessor.command : str =
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.'axivion_analysis'
external_postprocessor.enabled : bool =
Enable calling external command after compiling/linking.False
external_postprocessor.options : list[str] =
Options to pass to the external post-processing command. The IR file name will be appended to this list of options.['--quiet', '--brief', '--omit_disabled', '--ir']
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] =
File extensions for assembler.{'.S', '.asm', '.s'}
file_extensions.c : set[str] =
File extensions for the C language.{'.c', '.h', '.i'}
file_extensions.cpp : set[str] =
File extensions for the C++ language.{'.C', '.H', '.c++', '.cc', '.cpp', '.cxx', '.h++', '.hh', '.hpp', '.hxx', '.ii', '.inl', '.preinc', '.tcc'}
file_extensions.cuda : set[str] =
File extensions for the CUDA language.{'.cu', '.cuh'}
file_extensions.ignore : set[str] =
File extensions of files that are irrelevant and should be ignored.{'.res'}
file_extensions.library : list[str] =
File extensions used when searching for libraries with the['.so', '.dll', '.dylib', '.a', '.lib']cafeCC -lswitch. The order is relevant. An extension earlier in the list is preferred over an extension later in the list.
file_extensions.object : str =
The file extension used for object files that are created without an explicitly specified output filename.'.o'
file_extensions.qml : set[str] =
File extensions for QML files.{'.qml'}
file_extensions.response : set[str] =
File extensions of files that should be treated as compiler response files containing further switches to the tool.{'.rsp'}
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 =
Enabling an emulation mode has wide-ranging effects:'None'This corresponds to the
- activates support for vendor-specific language extensions
- sets some predefined macros
- emulates some compiler bugs
--microsoft,--gcc/--g++and--clangcommand-line switches.
language_c.emulated_compiler_version : int | None =
The version of the compiler to emulate.NoneExamples:
If this option is not specified,
--gnu_version=48010emulates GCC 4.8.1--gnu_version=100200emulates GCC 10.2--clang_version=100000emulates Clang 10.0--microsoft_version=1903emulates Visual Studio 2015 Update 3--microsoft_version=1916emulates Visual Studio 2017 Update 9--microsoft_version=1929emulates Visual Studio 2019 Update 11cafeCCwill attempt to automatically detect it using theadvanced.compiler_version_guessinglogic (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_versionswitch 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 =
Enables recognition of digraphs and (in C++) operator keywords.Noneint 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_tokenscommand-line option.
language_c.features.at_as_letter : bool =
Enables support for character at (@) inside identifiers or keywords, such asFalse@near.Corresponds to the
--at_as_lettercommand-line option.
language_c.features.at_operator : bool =
Enables support for theFalseint variable @ address;syntax.Corresponds to the
--at_operatorcommand-line option.
language_c.features.binary_literals : bool | None =
Controls support for binary literals (None0b01010).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_literalscommand-line options.
language_c.features.c11_atomic : bool =
Enables support for C11False_Atomicoutside of C11 mode.Corresponds to the
--c11_atomiccommand-line option.
language_c.features.c11_generic : bool =
Enables support for C11False_Genericoutside of C11 mode.Corresponds to the
--c11_genericcommand-line option.
language_c.features.c99_complex : bool =
Enables support for C99False_Complexand_Imaginary.In GNU/Clang mode, this option enables
_Imaginaryand changes the type of__I__from_Complex floatto_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_complexcommand-line option.
language_c.features.c99_inline : bool =
Enables support for C99Falseinlineoutside of C99 mode.Corresponds to the
--inlinecommand-line option.
language_c.features.c99_restrict : bool =
Enables support for C99Falserestrictoutside of C99 mode.Corresponds to the
--restrictcommand-line option.
language_c.features.clang_feature_test_macros : bool =
If enabled, the following Clang-style feature test macros are available (also in non-Clang modes):False__has_feature,__has_extension,__has_attribute,__has_builtin,__has_include_next, and__is_identifier.Corresponds to the
--clang_feature_test_macroscommand-line option.
language_c.features.designated_initializers : bool | None =
Controls support for designated initializers:None{ .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_designatorscommand-line options.
language_c.features.dollar_in_identifiers : bool =
If enabled, allows the usage of dollar ($) characters in identifiers.FalseCorresponds to the
--dollarcommand-line option.
language_c.features.flexible_array_members : bool =
Enables support for C99-style flexible array members:Falsestruct 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_memberscommand-line option.
language_c.features.gnu_attributes : bool =
Enables support for GNU-styleFalse__attribute__((...))outside of gcc mode.Corresponds to the
--gnu_attributescommand-line option.
language_c.features.iar_floats : bool =
Enable IAR-style float literalsFalse0.NaNand0.Infinity.Corresponds to the
--iar_floatscommand-line option.
language_c.features.ignore_tokens : bool =
Enables the following special keywords:FalseThe typical use of these keywords is to ignore vendor-specific language constructs that are not supported by
__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_bracketsexcept 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.cafeCC. For example, consider the following code:interrupt [42] void my_irq42_handler(void) { }cafeCCdoes not support thisinterruptconstruct. With#define interrupt __ignore_next_brackets,cafeCCwill ignore the interrupt vector entry and successfully parse the function definition.Corresponds to the
--ignore_tokenscommand-line option.
language_c.features.includes_both_sys_and_nonsys : bool =
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.FalseCorresponds to the
--diag_suppress=incl_dir_both_sys_and_nonsyscommand-line option.
language_c.features.incompatible_ptr_conversion : bool =
If enabled, implicit conversions between incompatible pointer types are allowed.FalseCorresponds to the
--incompatible_ptr_conversioncommand-line option.
language_c.features.language_strictness
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.Type: LanguageStrictness
Default:
'default'Corresponds to the
--strict_warningsand--strictcommand-line options.
language_c.features.stdarg_builtin : bool | None =
Enable or disable special treatment of theNonestdarg.hheader.When enabled, the
stdarg.handcstdargheaders 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 =
If enabled, the C23 terseFalse_Static_assertand the C++17 tersestatic_assert(i.e. one with only a single argument) are supported.Corresponds to the
--terse_static_assertcommand-line option.
language_c.features.trigraphs : bool =
Enables recognition of trigraphs.Falseint main() ??< ??>Trigraphs are not enabled by default in any compiler mode.
Corresponds to the
--trigraphs/--no_trigraphscommand-line option.
language_c.features.universal_asm : bool =
Enables support for inline assembler syntax in various formats:FalseThe
#pragma asm/#pragma endasm#asm/#endasmasm("nop")asm volatile("RRX %0, %1" : "=r"(result) : "r" (value) );__asm int 3asm { mov al, 2; mov dx, 0xD007; out dx, al }asm void f(void) { mov r0, #0 }asmand__asmkeywords can be used interchangeably.Corresponds to the
--universal_asmcommand-line option.
language_c.features.unrecognize_pragma_pack : bool =
Disables default recognition ofFalse#pragma pack(). This can be necessary if the original compiler uses#pragma packbut in a different syntactic way than what is typical for#pragma pack.Corresponds to the
--unrecognize_pragma=packcommand-line option.
language_c.features.variable_length_arrays : bool | None =
Controls support for C99 variable length arrays (VLA):Nonevoid test(int n) { int arr[n]; }If not specified, VLAs are enabled in C99 mode and GNU mode.
Corresponds to the
--vla/--no_vlacommand-line options.
language_c.features.variadic_macros
Controls support for C99 variadic macros:Type: VariadicMacros
Default:
'default'#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_macroscommand-line options.
language_c.features.void_ptr_arithmetic : bool =
If enabled, pointer arithmetic is also allowed on pointers toFalsevoid.Corresponds to the
--void_ptr_arithmeticcommand-line option.
language_c.language_version
Language version used by default (when not using a compiler switch likeType: CLanguageVersion
Default:
'C18'-std).
language_c.native_compiler : str | None =
Executable to invoke when calling the native compiler tool.NoneThis option is used by the
irCC/irCXXtools when performing a native build combined with the Axivion build.
language_c.preprocessing
Options for preprocessing.
language_c.preprocessing.extension : str =
Extension to use for preprocessed files.'i'
language_c.preprocessing.external_preprocessor
Configuration of the external preprocessor being used when enabled.
language_c.preprocessing.external_preprocessor.command : str =
External command to call for external preprocessing. The command must accept include paths with'gcc'-I, macro definitions with-Dand 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 =
Enable external preprocessor instead of internal one.False
language_c.preprocessing.external_preprocessor.options : list[str] =
Options to pass to the external preprocessor['-E']
language_c.preprocessing.external_preprocessor.response_file_format
Format to use whenType: ResponseFileFormat
Default:
'argument_per_line'cafeCCwrites 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] =
Lists names of macros that cannot be modified. Any attempt to change the macro value viaset()#defineor#undefwill 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_macroat 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
gccsetupwhich 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 thechartype 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 =
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 theNonesys_include_pathoption.
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 =
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 theNoneuser_include_pathoption.
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 =
This option defines whether vendor-specific predefined macros should be automatically set (the default) when operating in a respectiveTrueemulated_compilermode (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_0and__GLIBCXX_TYPE_INT_N_0in-std=gnu++*modes.
_MSC_VER,_MSC_FULL_VER,_MSC_BUILD,_MSC_EXTENSIONS,_WIN32,_M_IX86,_MSVC_LANG,_MSVC_TRADITIONAL,_MSVC_EXECUTION_CHARACTER_SETin Microsoft emulation mode.
_WIN64,_M_AMD64,_M_X64additionally 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 afterlanguage_cxx.default_options.This option takes effect only when compiling CUDA source files, and not when using
irNVCCon 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
Predefined macros for CUDA compilation; in addition to those predefined by theType: 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' }language_cxx.preprocessing.predefined_macrosoption.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 (unlesscombined_compilationis 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] =
Architecture IDs for which the device code should be compiled when{50, 52, 53, 60, 61, 62, 70, 72, 75, 80, 86, 87, 89, 90}-arch=allis used.This option uses architecture numbers as they appear in the
-archcommand-line switch, for examplecompute_70corresponds to70.Option
-arch=all-majorwill use all architectures in this set that are a multiple of 10.
language_cuda.analysis_architectures : str =
This option acts as a filter for the architectures for which device code is compiled.'$(CUDA_ANALYSIS_ARCH_LIST=)'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 =
If enabled, our compiler will compile both the host and device code in a single step. TheFalse__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] =
Files to include automatically at the beginning of every compilation unit, directly after those in the language-independent['$(builtin:AXIVION_INSTALLDIR)/profiles/cuda/axivion_preinc.h']preincludesoption.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
irNVCCon C or C++ files.
language_cuda.native_architectures : set[int] =
Architecture IDs for which the device code should be compiled when{52}-arch=nativeis used.This option uses architecture numbers as they appear in the
-archcommand-line switch, for examplecompute_52corresponds to52.This is also the set of architectures that will be used by default if
-archis not specified.
language_cuda.native_compiler : str | None =
Executable to invoke when calling the native CUDA compiler tool.NoneThis option is used by the
irNVCCtool 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 =
Enabling an emulation mode has wide-ranging effects:'None'This corresponds to the
- activates support for vendor-specific language extensions
- sets some predefined macros
- emulates some compiler bugs
--microsoft,--gcc/--g++and--clangcommand-line switches.
language_cxx.emulated_compiler_version : int | None =
The version of the compiler to emulate.NoneExamples:
If this option is not specified,
--gnu_version=48010emulates GCC 4.8.1--gnu_version=100200emulates GCC 10.2--clang_version=100000emulates Clang 10.0--microsoft_version=1903emulates Visual Studio 2015 Update 3--microsoft_version=1916emulates Visual Studio 2017 Update 9--microsoft_version=1929emulates Visual Studio 2019 Update 11cafeCCwill attempt to automatically detect it using theadvanced.compiler_version_guessinglogic (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_versionswitch 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
_Genericfeature 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 =
Enables recognition of digraphs and (in C++) operator keywords.Noneint 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_tokenscommand-line option.
language_cxx.features.at_as_letter : bool =
Enables support for character at (@) inside identifiers or keywords, such asFalse@near.Corresponds to the
--at_as_lettercommand-line option.
language_cxx.features.at_operator : bool =
Enables support for theFalseint variable @ address;syntax.Corresponds to the
--at_operatorcommand-line option.
language_cxx.features.binary_literals : bool | None =
Controls support for binary literals (None0b01010).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_literalscommand-line options.
language_cxx.features.c11_atomic : bool =
Enables support for C11False_Atomicoutside of C11 mode.Corresponds to the
--c11_atomiccommand-line option.
language_cxx.features.c11_generic : bool =
Enables support for C11False_Genericoutside of C11 mode.Corresponds to the
--c11_genericcommand-line option.
language_cxx.features.c99_complex : bool =
Enables support for C99False_Complexand_Imaginary.In GNU/Clang mode, this option enables
_Imaginaryand changes the type of__I__from_Complex floatto_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_complexcommand-line option.
language_cxx.features.c99_inline : bool =
Enables support for C99Falseinlineoutside of C99 mode.Corresponds to the
--inlinecommand-line option.
language_cxx.features.c99_restrict : bool =
Enables support for C99Falserestrictoutside of C99 mode.Corresponds to the
--restrictcommand-line option.
language_cxx.features.clang_feature_test_macros : bool =
If enabled, the following Clang-style feature test macros are available (also in non-Clang modes):False__has_feature,__has_extension,__has_attribute,__has_builtin,__has_include_next, and__is_identifier.Corresponds to the
--clang_feature_test_macroscommand-line option.
language_cxx.features.designated_initializers : bool | None =
Controls support for designated initializers:None{ .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_designatorscommand-line options.
language_cxx.features.dollar_in_identifiers : bool =
If enabled, allows the usage of dollar ($) characters in identifiers.FalseCorresponds to the
--dollarcommand-line option.
language_cxx.features.exceptions : bool =
Enable or disable support for exception handling.TrueCorresponds to the
--exceptions/--no_exceptionscommand-line options.
language_cxx.features.flexible_array_members : bool =
Enables support for C99-style flexible array members:Falsestruct 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_memberscommand-line option.
language_cxx.features.gnu_attributes : bool =
Enables support for GNU-styleFalse__attribute__((...))outside of gcc mode.Corresponds to the
--gnu_attributescommand-line option.
language_cxx.features.iar_floats : bool =
Enable IAR-style float literalsFalse0.NaNand0.Infinity.Corresponds to the
--iar_floatscommand-line option.
language_cxx.features.ignore_std_namespace : bool =
If enabled,Falsenamespace stdis considered an alias of the global namespace: any symbol declared innamespace stdwill be available globally and vice versa.Corresponds to the
--ignore_stdcommand-line option.
language_cxx.features.ignore_tokens : bool =
Enables the following special keywords:FalseThe typical use of these keywords is to ignore vendor-specific language constructs that are not supported by
__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_bracketsexcept 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.cafeCC. For example, consider the following code:interrupt [42] void my_irq42_handler(void) { }cafeCCdoes not support thisinterruptconstruct. With#define interrupt __ignore_next_brackets,cafeCCwill ignore the interrupt vector entry and successfully parse the function definition.Corresponds to the
--ignore_tokenscommand-line option.
language_cxx.features.includes_both_sys_and_nonsys : bool =
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.FalseCorresponds to the
--diag_suppress=incl_dir_both_sys_and_nonsyscommand-line option.
language_cxx.features.language_strictness
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.Type: LanguageStrictness
Default:
'default'Corresponds to the
--strict_warningsand--strictcommand-line options.
language_cxx.features.no_errors_in_templates : bool =
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.FalseFor 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_templatescommand-line option.
language_cxx.features.parse_templates
Controls when templates are parsed.Type: ParseTemplateMode
Default:
'automatic'See documentation of the enumerator values for details.
language_cxx.features.runtime_type_information : bool =
Enable or disable support for RTTI (runtime type information) features:Truedynamic_cast,typeid.Corresponds to the
--rtti/--no_rtticommand-line options.
language_cxx.features.stdarg_builtin : bool | None =
Enable or disable special treatment of theNonestdarg.hheader.When enabled, the
stdarg.handcstdargheaders 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 =
If enabled, the C23 terseFalse_Static_assertand the C++17 tersestatic_assert(i.e. one with only a single argument) are supported.Corresponds to the
--terse_static_assertcommand-line option.
language_cxx.features.trigraphs : bool =
Enables recognition of trigraphs.Falseint main() ??< ??>Trigraphs are not enabled by default in any compiler mode.
Corresponds to the
--trigraphs/--no_trigraphscommand-line option.
language_cxx.features.universal_asm : bool =
Enables support for inline assembler syntax in various formats:FalseThe
#pragma asm/#pragma endasm#asm/#endasmasm("nop")asm volatile("RRX %0, %1" : "=r"(result) : "r" (value) );__asm int 3asm { mov al, 2; mov dx, 0xD007; out dx, al }asm void f(void) { mov r0, #0 }asmand__asmkeywords can be used interchangeably.Corresponds to the
--universal_asmcommand-line option.
language_cxx.features.unrecognize_pragma_pack : bool =
Disables default recognition ofFalse#pragma pack(). This can be necessary if the original compiler uses#pragma packbut in a different syntactic way than what is typical for#pragma pack.Corresponds to the
--unrecognize_pragma=packcommand-line option.
language_cxx.features.variable_length_arrays : bool | None =
Controls support for C99 variable length arrays (VLA):Nonevoid test(int n) { int arr[n]; }If not specified, VLAs are enabled in C99 mode and GNU mode.
Corresponds to the
--vla/--no_vlacommand-line options.
language_cxx.features.variadic_macros
Controls support for C99 variadic macros:Type: VariadicMacros
Default:
'default'#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_macroscommand-line options.
language_cxx.features.void_ptr_arithmetic : bool =
If enabled, pointer arithmetic is also allowed on pointers toFalsevoid.Corresponds to the
--void_ptr_arithmeticcommand-line option.
language_cxx.language_version
Language version used by default (when not using a compiler switch likeType: CppLanguageVersion
Default:
'Cpp20'-std).
language_cxx.native_compiler : str | None =
Executable to invoke when calling the native compiler tool.NoneThis option is used by the
irCC/irCXXtools when performing a native build combined with the Axivion build.
language_cxx.preprocessing
Options for preprocessing.
language_cxx.preprocessing.extension : str =
Extension to use for preprocessed files.'ii'
language_cxx.preprocessing.external_preprocessor
Configuration of the external preprocessor being used when enabled.
language_cxx.preprocessing.external_preprocessor.command : str =
External command to call for external preprocessing. The command must accept include paths with'g++'-I, macro definitions with-Dand 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 =
Enable external preprocessor instead of internal one.False
language_cxx.preprocessing.external_preprocessor.options : list[str] =
Options to pass to the external preprocessor['-E']
language_cxx.preprocessing.external_preprocessor.response_file_format
Format to use whenType: ResponseFileFormat
Default:
'argument_per_line'cafeCCwrites 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] =
Lists names of macros that cannot be modified. Any attempt to change the macro value viaset()#defineor#undefwill 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_macroat 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
gccsetupwhich 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 thechartype 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 =
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 theNonesys_include_pathoption.
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 =
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 theNoneuser_include_pathoption.
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 =
This option defines whether vendor-specific predefined macros should be automatically set (the default) when operating in a respectiveTrueemulated_compilermode (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_0and__GLIBCXX_TYPE_INT_N_0in-std=gnu++*modes.
_MSC_VER,_MSC_FULL_VER,_MSC_BUILD,_MSC_EXTENSIONS,_WIN32,_M_IX86,_MSVC_LANG,_MSVC_TRADITIONAL,_MSVC_EXECUTION_CHARACTER_SETin Microsoft emulation mode.
_WIN64,_M_AMD64,_M_X64additionally 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 =
Maximum number of access control declarations in a class. None means 'unlimited'.4096
limits.at_quick_exit_functions : int | None =
Maximum number of functions registered by at_quit_exit(). None means 'unlimited'.32
limits.atexit_functions : int | None =
Maximum number of functions registered by atexit(). None means 'unlimited'.32
limits.base_classes : int | None =
Maximum number of direct and indirect base classes. None means 'unlimited'.16384
limits.call_arguments : int | None =
Maximum number of arguments in a function call. None means 'unlimited'.256
limits.catch_handlers : int | None =
Maximum number of handlers per try block. None means 'unlimited'.256
limits.chars_in_line : int | None =
Maximum number of characters in a line. None means 'unlimited'.65536
limits.chars_in_string : int | None =
Maximum number of characters in a string literal. None means 'unlimited'.65536
limits.clauses_braced_init_list : int | None =
Maximum number of initializer-clauses in one braced-init-list.16384
limits.cpp_members : int | None =
Maximum number of all members (not just data members) in a class. None means 'unlimited'.4096
limits.data_members : int | None =
Maximum number of members in a class, struct or union. None means 'unlimited'.16384
limits.direct_bases : int | None =
Maximum number of direct base classes for a single class. None means 'unlimited'.1024
limits.enumerators : int | None =
Maximum number of enumeration constants in an enum type. None means 'unlimited'.4096
limits.expr_in_core_constant : int | None =
Maximum number of full expressions evaluated within a core constant expression. None means 'unlimited'.1048576
limits.external_identifiers : int | None =
Maximum number of external identifiers in a unit. None means 'unlimited'.65536
limits.final_virtual_functions : int | None =
Maximum number of final overriding virtual functions in a class. None means 'unlimited'.16384
limits.friends : int | None =
Maximum number of friend declarations in a class. None means 'unlimited'.4096
limits.function_parameters : int | None =
Maximum number of parameters in a function definition. None means 'unlimited'.256
limits.lambda_captures : int | None =
Maximum number of lambda-captures in one lambda-expression.256
limits.macro_arguments : int | None =
Maximum number of parameters in a macro invocation. None means 'unlimited'.256
limits.macro_parameters : int | None =
Maximum number of parameters in a macro definition. None means 'unlimited'.256
limits.macros : int | None =
Maximum number of macro definitions in a translation unit. None means 'unlimited'.65536
limits.member_initializers : int | None =
Maximum number of member initializers in a constructor definition. None means 'unlimited'.6144
limits.nested_blocks : int | None =
Maximum nesting levels. None means 'unlimited'.256
limits.nested_composites : int | None =
Maximum nesting levels of classes, structs and unions. None means 'unlimited'.256
limits.nested_declarators : int | None =
Maximum number of pointer, array, and function declarators in a declaration. None means 'unlimited'.256
limits.nested_externals : int | None =
Maximum number of nested external specifications. None means 'unlimited'.1024
limits.nested_includes : int | None =
Maximum nesting level for #includes. None means 'unlimited'.256
limits.nested_preprocessor_ifs : int | None =
Maximum nesting levels for preprocessor #ifs. None means 'unlimited'.256
limits.nested_template_instantiations : int | None =
Maximum number of recursively nested template instantiations. None means 'unlimited'.1024
limits.object_size : int | None =
Maximum number of bytes in an object. None means 'unlimited'.262144
limits.parenthesized_declarators : int | None =
Maximum number of declarators in parens within a full declarator. None means 'unlimited'.256
limits.parenthesized_expressions : int | None =
Maximum number of expressions in parens within a full expression. None means 'unlimited'.256
limits.placeholders : int | None =
Maximum number of placeholders. None means 'unlimited'.10
limits.recursive_constexpr : int | None =
Maximum number of recursive constexpr function invocations. None means 'unlimited'.512
limits.scope_qualifications : int | None =
Maximum number of scope qualifications of one identifier. None means 'unlimited'.256
limits.significant_chars_external : int | None =
Maximum number of significant initial characters for external identifiers. None means 'unlimited'.1024
limits.significant_chars_internal : int | None =
Maximum number of significant initial characters for internal identifiers and macros. None means 'unlimited'.1024
limits.static_members : int | None =
Maximum number of static members in a class. None means 'unlimited'.1024
limits.structured_bindings : int | None =
Maximum number of structured bindings introduced in one declaration. None means 'unlimited'.256
limits.switch_cases : int | None =
Maximum number of case labels in a switch statement. None means 'unlimited'.16384
limits.template_params : int | None =
Maximum number of template parameters in a template declaration. None means 'unlimited'.1024
limits.throw_spec : int | None =
Maximum number of throw specifications on a single function declaration. None means 'unlimited'.256
limits.variables_in_block : int | None =
Maximum number of variables in a block. None means 'unlimited'.1024
limits.virtual_bases : int | None =
Maximum number of direct and indirect virtual bases of a class. None means 'unlimited'.1024
linker¶
Configuration for the linker tool.
linker.advanced
Advanced options that control linking behaviour.
linker.advanced.always_link_against_libraries : bool =
If enabled, shared libraries are linked in every time, else only in the final link step.False
linker.advanced.disable_all_messages : bool =
If enabled, sets all messages to "disabled", overriding whatever has been set up in the 'messages' option.False
linker.advanced.ignore_input_files : set[bauhaus.analysis.config.FileGlobPattern] =
Do not consider files matching these patterns for linking. This allows special files to be excluded without having to change the build process.set()
linker.advanced.ignore_missing_files : set[bauhaus.analysis.config.FileGlobPattern] =
Globbing patterns where linking is ok even if files are missing.{'/*', '[A-Za-z]:[\/]*'}
linker.advanced.messages
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.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' }
linker.advanced.remove_input_files : set[bauhaus.analysis.config.FileGlobPattern] =
Globbing patterns of files to remove after successful link step.set()
linker.default_options : list[str] =
Options being prepended to the[]irlinkcall.
linker.include_unused : bool =
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.FalseIf 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_unusedlinker 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-Larguments on the compiler command line.Note: Library search is a feature of the
cafeCCcompiler driver. When callingirlinkdirectly, no search will be performed.
linker.library_path_envvar : str | None =
Name of environment variable that contains the library search path for the linker.'LIBRARY_PATH'
linker.native_linker : str | None =
Executable to invoke when calling the native linker tool.NoneThis option is used by the
irLDtool when performing a native build combined with the Axivion build.If unset, then
native_compilerfrom the language options of the selected compiler rule is used.
linker.native_objcopy : str | None =
Executable to invoke when calling the native objcopy tool.'$(OBJCOPY=)'This option is used by the
irOBJCOPYtool when performing a native build combined with the Axivion build.
linker.native_strip : str | None =
Executable to invoke when calling the native strip tool.'$(STRIP=)'This option is used by the
irSTRIPtool when performing a native build combined with the Axivion build.
linker.search_object_files_in_library_path : bool =
Whether file names detected as object file names on theFalsecafeCCcommand-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] = []
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 =
If enabled, command-line switches starting with a slash are considered equivalent to switches starting with a minus. For example, a command-line switchFalse-Iwill match the switch mapping key/Iand 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
The switch mapping allows reconfiguring howType: 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' ) }cafeCCinterprets command-line switches.
switches.passthrough_double_minus : bool =
Whether unmapped switches starting withTrue--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
Controls howType: ResponseFileFormat
Default:
'host'cafeCCwill tokenize when reading from response files.
switches.response_file_preprocessor : str | 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.NoneIf enabled,
cafeCCwill run the specified command for each response file. The name of the response file will be appended as an argument to the command-line.cafeCCwill then read the stdout of the command instead of the response file.In this mode, the option
response_file_formatcontrols howcafeCCwill tokenize the stdout produced by the preprocessor script.
target_platform¶
target_platform : TargetPlatform = 'none'
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
Basic type to be used forType: BasicIntegerType | None
Default:
Nonechar16_t.This option controls the type used by the compiler for wide string literals (
u"abc"). In C++ wherechar16_tis 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
Basic type to be used forType: BasicIntegerType | None
Default:
Nonechar32_t.This option controls the type used by the compiler for wide string literals (
U"abc"). In C++ wherechar32_tis 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 =
Number of bits in a8char. As all other type sizes are specified as multiples ofsizeof(char), this setting influences the size-in-bits of all types.
types.char_unsigned : bool =
If enabled, plainFalsecharis treated as unsigned (signed otherwise).Corresponds to the
--unsigned_charscommand-line option.
types.double_type
Allows configuring the size and alignment of the typedouble.For the purposes of compile-time calculations, type
doubleis always treated as a IEEE "binary64" 64-bit floating-point type.
types.double_type.alignof : int =
The alignment of the data type, in multiples of8sizeof(char).
alignofmust be a power of two.
types.double_type.sizeof : int =
The size of the data type, in multiples of8sizeof(char).
sizeofmust be a multiple ofalignof.
types.float_type
Allows configuring the size and alignment of the typefloat.For the purposes of compile-time calculations, type
floatis always treated as a IEEE "binary32" 32-bit floating-point type.
types.float_type.alignof : int =
The alignment of the data type, in multiples of4sizeof(char).
alignofmust be a power of two.
types.float_type.sizeof : int =
The size of the data type, in multiples of4sizeof(char).
sizeofmust be a multiple ofalignof.
types.int_type
Allows configuring the size and alignment of the typessigned intandunsigned int.
types.int_type.alignof : int =
The alignment of the data type, in multiples of4sizeof(char).
alignofmust be a power of two.
types.int_type.sizeof : int =
The size of the data type, in multiples of4sizeof(char).
sizeofmust be a multiple ofalignof.
types.long_double_type
Allows configuring the size and alignment of the typelong double.For the purposes of compile-time calculations, type
long doublewill 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 =
The alignment of the data type, in multiples of16sizeof(char).
alignofmust be a power of two.
types.long_double_type.sizeof : int =
The size of the data type, in multiples of16sizeof(char).
sizeofmust be a multiple ofalignof.
types.long_long_type
Allows configuring the size and alignment of the typessigned long longandunsigned long long.
types.long_long_type.alignof : int =
The alignment of the data type, in multiples of8sizeof(char).
alignofmust be a power of two.
types.long_long_type.sizeof : int =
The size of the data type, in multiples of8sizeof(char).
sizeofmust be a multiple ofalignof.
types.long_type
Allows configuring the size and alignment of the typessigned longandunsigned long.
types.long_type.alignof : int =
The alignment of the data type, in multiples of8sizeof(char).
alignofmust be a power of two.
types.long_type.sizeof : int =
The size of the data type, in multiples of8sizeof(char).
sizeofmust be a multiple ofalignof.
types.named_address_spaces
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.Type: dict[str, NamedAddressSpace]
Default:
{}
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 =
The alignment of the data type, in multiples of8sizeof(char).
alignofmust be a power of two.
types.pointer_type.sizeof : int =
The size of the data type, in multiples of8sizeof(char).
sizeofmust be a multiple ofalignof.
types.preferred_enum_base_type
Base type for C enums and C++ enums that do not explicitly specify a base. Does not apply to scoped enums (C++Type: BasicIntegerType | None
Default:
Noneenum 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_enumsswitch.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
Basic type to be used forType: SignedBasicIntegerType | None
Default:
Noneptrdiff_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 =
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).NoneCorresponds to the
--short_enums/--no_short_enumscommand-line option.
types.short_type
Allows configuring the size and alignment of the typessigned shortandunsigned short.
types.short_type.alignof : int =
The alignment of the data type, in multiples of2sizeof(char).
alignofmust be a power of two.
types.short_type.sizeof : int =
The size of the data type, in multiples of2sizeof(char).
sizeofmust be a multiple ofalignof.
types.size_t_type
Basic type to be used forType: UnsignedBasicIntegerType | None
Default:
Nonesize_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
Basic type to be used forType: SignedBasicIntegerType | None
Default:
Nonessize_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
Basic type to be used forType: BasicIntegerType | None
Default:
Nonewchar_t.This option controls the type used by the compiler for wide string literals (
L"abc"). In C++ wherewchar_tis 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,charwhich has the same size aswchar_ton 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
Basic type to be used forType: BasicIntegerType | None
Default:
Nonewint_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 optionswitches.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 configuredobject_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 theOutputFile
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 configureddefault_mode.PreprocessMode
Enable preprocessor-only mode (-E). This switch will override the configureddefault_mode.LinkMode
Enable link mode. This switch will override the configureddefault_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 configureddefault_mode.ArchiveModeWithOutputFile
Enable archive mode (-archive). Create static library. This switch will override the configureddefault_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 thegiraffe 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: unlikeCPlusPlusMode, 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 compilernvcc.
This switch will enable the following options, even for non-CUDA code:
language_cuda.additional_predefined_macroslanguage_cuda.additional_sys_include_pathlanguage_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 thenvcc -arch switch.CudaGenerateCode
Specify CUDA architecture/code tuples. Used for thenvcc -gencode
switch.CudaHost
Enable CUDA mode, but compile only the host code. Corresponds to theCudaDevice
Enable CUDA mode, but compile only the device code. Takes the CUDA architecture number as parameter. Corresponds to theThis option only has an effect in linking mode.
ExecutableLinking
Link as executable. The linker will expect amain 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 toNoStdInc 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 byNote: 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
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 byDependencyMode or DependencyPreprocessMode.DependencyPreprocessMode
Activate preprocess mode, but instead of preprocessor output, print amake 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 amake rule
with dependencies on the included headers.DependencyTargetQuote
InDependencyMode or DependencyPreprocessMode,
controls the name of the make target.
Special characters in the parameter will be quoted.
DependencyTarget
InDependencyMode 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 likeCompileModeexcept it will also output preprocessed code tostdout.DependencyPreprocessMode(-M) will act likeDependencyMode(-MD).- If neither
PreprocessModenorDependencyPreprocessModeare 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.Link
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 withgcc -c.Preprocess
In this mode, input files must be source files. The sources will be preprocessed but not compiled, as withgcc -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
_Pragmaoperatorextern templatefriend type-name;
Cpp03
ISO/IEC 14882:2003Cpp11
ISO/IEC 14882:2011Cpp14
ISO/IEC 14882:2014Cpp17
ISO/IEC 14882:2017Cpp20
ISO/IEC 14882:2020Cpp23
ISO/IEC 14882:2024EmulationMode¶
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
Action or replacement.Type: CompilerDriverAction | str
Default:
'IgnoreSwitch'
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'
NamedAddressSpace¶
Used in thetypes.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
pointer_type
The size and alignment of a pointer to this named address space.
pointer_type.alignof : int =
The alignment of the data type, in multiples of8sizeof(char).
alignofmust be a power of two.
pointer_type.sizeof : int =
The size of the data type, in multiples of8sizeof(char).
sizeofmust be a multiple ofalignof.
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 onemulated_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 (likeCommandLineToArgvW, 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-1UTF8
UTF-8TargetPlatform¶
An enumeration.none
Platform-specific features and builtin functions are not available. Platform-independent builtin functions remain available (depending on theemulation_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)