JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
Configuration presets are named combinations of configuration parameter settings that can be applied directly in the CodeSonar build/analysis command.
See also Configuration Files: Default Presets.
Configuration presets are named combinations of configuration parameter settings that can be applied directly in the CodeSonar build/analysis command.
| Location | Each preset is located in directory $CSONAR/codesonar/presets/, with a file name of the form PresetName.conf where PresetName is the name of the preset. Any file that meets these conditions will be treated as an available preset. |
|---|---|
| Contents | Each preset is a text file containing zero or more configuration parameter settings. |
| Applying | Presets are applied by name (the path and the .conf file extension are implicit) as described in Applying a Preset, below. |
| Available Presets | CodeSonar ships with a number of presets. You can also define custom presets and modify existing presets. |
| Precedence | Applied presets are loaded after the general template configuration file, but before any other applicable configuration files. They therefore can override settings specified in the general template, but can themselves be overridden by settings specified in other files. For full details, see Configuration Files: Configuration File Loading. |
There are two major differences between applying a preset and specifying an additional configuration file: location and loading mechanism.
| Preset | Additional Configuration File | |
|---|---|---|
| location | $CSONAR/codesonar/presets/PresetName.conf only | anywhere |
| loading mechanism | -preset
PresetName (No path or .conf extension) |
-conf-file
/path/to/fname (Path required, fname must include file extension if it has one.) |
To apply the preset named PresetName (defined in $CSONAR/codesonar/presets/PresetName.conf) to a CodeSonar build/analysis:
| Command Line |
Specify -preset <preset_name> as part of your
build/analysis command. For example:
codesonar analyze MyProj -preset <preset_name> localhost:7340 make
|
|---|---|
| Define as a default preset | Copy <preset_name>.conf from $CSONAR/codesonar/presets/ to $CSONAR/codesonar/default_presets/. OR Use the CodeSonar Configuration Tool Modify Analysis Settings option. |
| Windows Build Wizard | Select <preset_name> from the Preset list on screen 2. |
| Eclipse Plug-In | Select <preset_name> from the Presets list in the Properties dialog. |
| Visual Studio Plug-In | Select <preset_name> from the Presets list in the Project Properties dialog. |
Configuration Files: Changing Parameter Settings discusses the issues to consider when you change parameter settings for a given project, including changes in the presets used to build and analyze the project.
The following presets are shipped with CodeSonar.
For presets that enable sets of warning classes associated with one or more warning class categories, the close mapping for that category is used.
| Preset Name | Description |
|---|---|
| all_warningclasses |
Enable all warning classes (except those with mnemonic DIAG.*,
which are diagnostic only) for all languages to which each
class applies.
This preset sets INCREMENTAL_BUILD = No. See the section below for expanded explanations of this parameter. |
| android_base | Set various analysis bounds and compiler model mappings to
support analyzing the Android Open Source Project with codesonar
cs_android.py. We recommend using this preset whenever your CodeSonar build/analysis makes use of codesonar cs_android.py. |
| allow_many_parse_errors |
Set a very high ERROR_LIMIT_PER_COMPILATION.
Note that this preset sets PREPROCESS_IF_FAIL = No, which specifies that preprocessed versions of compilation units containing parse errors will not be saved. |
| autosarc++14 |
Taxonomy preset for AUTOSARC++14: AUTOSAR AP Release 18-10
Guidelines for the use of the C++14 language in critical and
safety-related systems.
Enables warning classes for C++ compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| autosarc++14_inc |
Taxonomy preset for AUTOSARC++14: AUTOSAR AP Release 18-10
Guidelines for the use of the C++14 language in critical and
safety-related systems.
Enables warning classes for C++ compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| barr_naming | Check for violations of the naming rules in the Barr Group Embedded C Coding Standard; issue a Naming Style Violation warning for each such violation. |
| bsi | Enable all warning classes (except those with mnemonic DIAG.*, which are diagnostic only) associated with "Build Security In" (BSI) rules. A number of CodeSonar warning classes have been implemented specifically to support rules previously published by the U.S. Department of Homeland Security "Build Security In" (BSI) initiative. |
| cert |
Taxonomy preset for multiple
CERT taxonomies:
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and INCREMENTAL_BUILD = No. See the sections below for expanded explanations of these parameters. |
| certc |
Taxonomy preset for CERT-C: SEI CERT C Coding Standard.
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and INCREMENTAL_BUILD = No. See the sections below for expanded explanations of these parameters. |
| certcpp |
Taxonomy preset for CERT-CPP: SEI CERT C++ Coding
Standard.
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| certjava |
Taxonomy preset for CERT-Java: SEI CERT Oracle Coding Standard
for Java.
Enables warning classes that are associated with at least
one rule or recommendation in the SEI CERT Oracle Coding
Standard for Java. |
| concurrency | Enable all C and C++ warning classes (except those with mnemonic DIAG.*, which are diagnostic only) that are related to multithreaded programs (that is, the classes with CONCURRENCY.* mnemonics). |
| csharp_complete | Enable all warning classes detected in C# code: both CodeSonar-detected C# warning classes and Roslyn-detected C# warning classes. |
| csharp_deep | Enable all CodeSonar-detected C# warning
classes that are characterized as deep. Note: This preset does not enable any Roslyn-detected C# warning classes (those with mnemonic ROSLYN.*). |
| csharp_no_roslyn | Disable all Roslyn-detected C# warning classes (those with mnemonic ROSLYN.*). |
| csharp_pedantic | Enable all CodeSonar-detected C# warning
classes that are characterized as pedantic. Note: This preset does not enable any Roslyn-detected C# warning classes (those with mnemonic ROSLYN.*). |
| csharp_security | Enable all CodeSonar-detected C# warning
classes whose significance is
"security". Note: This preset does not enable any Roslyn-detected C# warning classes (those with mnemonic ROSLYN.*). |
| csharp_roslyn_allrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the AllRulesDefault ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_allrulesenabled | Enable the set of Roslyn-detected C# warning
classes equivalent to the AllRulesEnabled ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_designrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the DesignRulesDefault ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_globalizationrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the GlobalizationRulesDefault ruleset provided
by microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_interoperabilityrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the InteroperabilityRulesDefault ruleset
provided by microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_maintainabilityrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the MaintainabilityRulesDefault ruleset provided
by microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_performancerulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the PerformanceRulesDefault ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_portedfromfxcoprulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the PortedFromFxCopRulesDefault ruleset provided
by microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_reliabilityrulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the ReliabilityRulesDefault ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| csharp_roslyn_usagerulesdefault | Enable the set of Roslyn-detected C# warning
classes equivalent to the UsageRulesDefault ruleset provided by
microsoft.codeanalysis.netanalyzers
8.0.0. Note: This preset does not enable any CodeSonar-detected C# warning classes (those with mnemonic CSHARP.*). |
| cwe2020 |
Enable all warning classes that are closely mapped to one or
more of the 2020 CWE/SANS Top
25 Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe2021 |
Enable all warning classes that are closely mapped to one or
more of the 2021 CWE Top 25
Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe2022 |
Enable all warning classes that are closely mapped to one or
more of the 2022 CWE Top 25
Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe2023 |
Enable all warning classes that are closely mapped to one or
more of the 2023 CWE Top 25
Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe2024 |
Enable all warning classes that are closely mapped to one or
more of the 2024 CWE Top 25
Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe2025 |
Enable all warning classes that are closely mapped to one or
more of the 2025 CWE Top 25
Most Dangerous Software Weaknesses.
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| cwe_kev10_2024 | Enable all warning classes that are closely mapped to one or more of the 2024 CWE Top 10 KEV Weaknesses. |
| cwe660_java | Enable all Java warning classes that are broadly mapped to CWE:660. |
| cxx_parser_diagnostics | Enable all C/C++ parser warning classes, reporting both parser warnings and parser errors. The latter has the effect of duplicating errors from the parse log as CodeSonar warnings. |
| cxx_parser_warnings | Enable all C/C++ parser warning classes, but only for warnings that correspond to parser warnings (as opposed to parser errors). Note that error status for these warnings is determined by the parser: for a given warning class, there may be some warning instances that are parse errors but other warning instances that are not. |
| disa |
Taxonomy preset for multiple
taxonomies:
These represent all revisions of the DISA Application Security and Development STIG for which CodeSonar has mappings. Enables warning classes only if both of the following are true:
Does not enable warning classes that are diagnostic-only (mnemonic DIAG.*). This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| disa_latest |
Taxonomy preset for the most
recent version of the DISA Application Security and
Development STIG for which CodeSonar has mappings.
For this version of CodeSonar (9.2p0), the most recent version of this STIG for which mappings are provided is Version 6, Release 1, published June 5, 2024. Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| disa_6r1 |
Taxonomy preset for DISA-6r1: DISA Application Security and
Development STIG version 6 release 1 (published June 5,
2024).
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| disa_5r3 |
Taxonomy preset for DISA-5r3: DISA Application Security and
Development STIG version 5 release 3 (published July 26,
2023). Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| disa_4r3 |
Taxonomy preset for DISA-4r3: DISA Application Security and
Development STIG version 4 release 3 (published April 28,
2017).
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| disa_3r10 |
Taxonomy preset for DISA3r10: DISA Application Security and
Development STIG version 3 release 10 (published January 23,
2015).
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| dry_run | Perform a dry run. |
| fast | Set lower values for various analysis bounds and disable Tainted Buffer Access checking, with the goal of a faster analysis. This preset may lead to a higher number of false negatives (because of reduced analysis resources), a higher number of false positives (because of reduced refinement resources), or both. Settings are described in section Performing a Fast Analysis. |
| his_metrics | Enable HIS and related metrics. |
| insider | Enable those built-in warning classes that are considered to be particularly associated with insider threat. Many of these warning classes have a focus on security holes that can be introduced - maliciously or mistakenly - by an insider. Insider threats are rare, so this preset tends to have a high false positive rate. |
| insider_more | Enable a strict superset of the warning classes enabled by the insider preset; set various other parameters to support stricter checking for various classes. Many of these warning classes have a focus on security holes that can be introduced - maliciously or mistakenly - by an insider. Insider threats are rare, so this preset tends to have a high false positive rate |
| insider_only | Enable those built-in warning classes that are considered to be particularly associated with insider threat; disable all other classes. Many of these warning classes have a focus on security holes that can be introduced - maliciously or mistakenly - by an insider. Insider threats are rare, so this preset tends to have a high false positive rate |
| intel |
[Windows only] Disables compiler
recognition for the cl
and
cl.exe executables, and
specifies that compilations with mcpcom.exe should be handled by the
mcpcom compiler model. Always use this preset when
you are building and analyzing projects based on the
mcpcom compiler (or any other
compilers that you have mapped to the mcpcom compiler model).
This preset has no effect on non-Windows systems. |
| intro | Disable some warning classes that are less likely to indicate serious defects. |
| java_complete | Enable all Java warning classes. |
| java_deep | Enable all Java warning classes that are characterized as deep. |
| java_pedantic | Enable all Java warning classes that are characterized as pedantic. |
| java_security | Enable all Java warning classes whose significance is "security". |
| jpl |
Taxonomy preset for JPL:
JPL Institutional Coding Standard for the C Programming
Language.
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| jsf++ |
Taxonomy preset for JSF++:
Joint Strike Fighter Air Vehicle C++ Coding Standards for
the System Development and Demonstration Program.
Enables warning classes only if both of the following are true:
Additional jsf++ preset information:
|
| jsf++_inc |
Taxonomy preset for
JSF++: Joint Strike Fighter
Air Vehicle C++ Coding Standards for the System Development and
Demonstration Program. Enables warning classes for C++ compilation units, and only if all of the following are true:
Additional jsf++_inc preset information:
|
| malloc_never_fails | Set MALLOC_FAILURE_BEHAVIOR=DOESNT_FAIL. |
| misra |
Taxonomy preset for multiple
MISRA C taxonomies:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra_inc |
Taxonomy preset for multiple
taxonomies:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac2025 |
Taxonomy preset for MisraC2025: MISRA C:2025 Guidelines for
the use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac2025_inc |
Taxonomy preset for MisraC2025: MISRA C:2025 Guidelines for
the use of the C language in critical systems.
Enables warning classes for C compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac2023 |
Taxonomy preset for MisraC2023: MISRA C:2023 Guidelines for
the use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac2023_inc |
Taxonomy preset for MisraC2023: MISRA C:2023 Guidelines for
the use of the C language in critical systems.
Enables warning classes for C compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012_inc |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems. Enables warning classes for C compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012-0 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012-1 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012-2 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012-3 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2012-4 |
Taxonomy preset for Misra2012: MISRA C:2012 Guidelines for the
use of the C language in critical systems. Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2004 |
Taxonomy preset for Misra2004: MISRA C:2004 Guidelines for the
use of the C language in critical systems. Enables warning classes for C compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misra2004_inc |
Taxonomy preset for Misra2004: MISRA C:2004 Guidelines for the
use of the C language in critical systems.
Enables warning classes for C compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++ |
Taxonomy preset for multiple
MISRA C++ taxonomies:
Enables warning classes for C++ compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++_inc |
Taxonomy preset for multiple
taxonomies:
Enables warning classes for C++ compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++2023 |
Taxonomy preset for MisraC++2023: MISRA C++:2023 Guidelines
for the use of C++17 in critical systems.
Enables warning classes for C++ compilation units, and only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++2023_inc |
Taxonomy preset for MisraC++2023: MISRA C++:2023 Guidelines
for the use of C++17 in critical systems.
Enables warning classes for C++ compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++2008 |
Taxonomy preset for MisraC++2008: MISRA C++:2008 Guidelines
for the use of the C++ language in critical systems.
Enables warning classes for C++ compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes, INCREMENTAL_BUILD = No, and WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| misrac++2008_inc |
Taxonomy preset for MisraC++2008: MISRA C++:2008 Guidelines
for the use of the C++ language in critical systems.
Enables warning classes for C++ compilation units, and only if all of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and sets WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>. See the sections below for expanded explanations of these parameters. |
| no_crashes | Configure the analysis so that Null Pointer Dereference, Division by Zero, and integer division overflow will not be treated as crashing vulnerabilities. |
| no_cxx_parser_diagnostics | Disable all C/C++ parser warning classes. |
| no_dead_code |
Disable C/C++ warning classes with significance
redundancy. These warning
classes generally flag dead (unnecessary) code. Dead code is
sometimes intentional but is sometimes indicative of mistakes.
It is recommended that first-time CodeSonar users disable dead code warnings. |
| no_incremental | Set INCREMENTAL_BUILD=No. For more information on this parameter, see the section below. |
| no_style | Disable C/C++ warning classes with significance style. Suppress coding-style warnings. |
| no_taint_or_funcptr |
Disable the top-down pointer
analysis phase, meaning that:
|
| owasp2025 |
Taxonomy preset for OWASP-2025: the OWASP Top 10 2025.
Enables warning classes only if both of the following are true:
|
| owasp2021 |
Taxonomy preset for OWASP-2021: the OWASP Top 10 2021.
Enables warning classes only if both of the following are true:
|
| owasp2017 |
Taxonomy preset for OWASP-2017: the OWASP Top 10 2017.
Enables warning classes only if both of the following are true:
|
| pow10 |
Taxonomy preset for POW10: "Power of Ten" rules.
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes. See the section below for an expanded explanation of this parameter. |
| python_debug_console | Include the Python debug console plug-in, which opens an interactive Python console at the end of the analysis "Linking" stage; analysis does not proceed until the console exits. For more information, see the Python API documentation. |
| security | Enable those built-in C/C++ warning classes that are considered especially useful for security audits. Settings are described in section Performing a Security-Oriented Analysis. |
| serial | Configure the analysis to run in serial mode (including after the analysis has transitioned to daemon mode). |
| stable_results | Configure the analysis for increased determinism: result sets will be more stable across analyses than without these settings, at the cost of increased false negative rate and slower taint analysis. False positives may increase or decrease. Apply all the settings described in section Performing an Analysis with Improved Determinism. |
| thorough | May enable a more thorough analysis. Settings are described in section Performing a More Thorough Analysis. |
| ts17961 |
Taxonomy preset for TS17961: ISO/IEC TS 17961 rules ("C
Secure Coding Rules Technical Specification").
Enables warning classes only if both of the following are true:
This preset sets RETAIN_UNNORMALIZED_C_AST = Yes and INCREMENTAL_BUILD = No. See the sections below for expanded explanations of these parameters. |
| weakprng | Enable those built-in warning classes that flag uses of some well-known weak pseudo-random number generators. |
We say that a preset shipped with CodeSonar is a taxonomy preset if it enables warning classes on the basis of their association with one or more standard category kinds ("taxonomies").
For a given warning class C, a taxonomy preset will enable C if all of the following are true.
For example, the Inappropriate Include File Specification warning class is closely mapped to MisraC2023:20.3 (The #include directive shall be followed by either a <filename> or "filename" sequence). However, the Malformed #include class is an even closer match. The misrac2023 preset therefore contains a WARNING_FILTER rule enabling the latter but does not contain a rule enabling the former.
When a warning class is omitted from a taxonomy preset for this reason, the preset file contains an explanatory comment.
A taxonomy may have multiple associated taxonomy presets.
Note: CWE top 25 presets such as cwe2024 are not considered taxonomy presets.
This setting is used because normalized ASTs don't hold the right data to decide for certain warning classes, so certain presets are configured to retain the required data structure. CodeSonar preserves this "extra" data required by the warning classes enabled by the preset.
This setting is used because incremental build is not compatible with warning classes that depend on global state. For example, non-unique identifier warnings require knowledge of every identifier in the project, so CodeSonar must parse and analyze all compilation units to issue these warnings.
Some presets are configured to disable INCREMENTAL_BUILD so the entire project can be rebuilt and analyzed.
The standard way to write the prototype for main() is to use basic numerical types: int main(int argc, char* argv[]), but the Basic Numerical Type Used warning class complains about that usage. CodeSonar provides an exception for the prototype of main.
For more information on the options, see the WARNING_FILTER documentation.
For detailed information about any preset, inspect the corresponding configuration file. For example, to see the settings associated with the thorough preset, inspect $CSONAR/codesonar/presets/thorough.conf.
We do not recommend editing the built-in presets directly. If you want a preset that is a variation of some built-in preset PresetName:
| command line |
Specify -preset
MyPresetName as part of your build/analysis
command. For example:
codesonar analyze ProjectX -preset MyPresetName
localhost:7340 gcc -c myfile.c
|
|---|---|
| Windows build wizard | Select MyPresetName from the Preset list on screen 2. |
Suppose you want to create a new preset called AlexCustom.
| command line |
codesonar analyze testAlexCustom -preset AlexCustom
localhost:7340 gcc -c myfile.c
|
|---|---|
| Windows build wizard | Select AlexCustom from the Preset list on screen 2. |
To report problems with this documentation, please visit https://support.codesecure.com/.