polyspace.ModelLinkOptions Properties
Customize Polyspace analysis of generated code with options object properties
To customize your Polyspace® analysis
of generated code, modify the polyspace.ModelLinkOptions
object
properties. Each property corresponds to an analysis option on the
Configuration pane in the Polyspace user interface.
The properties are grouped using the same categories as the Configuration pane. This page only shows what values each property can take. For details about:
The different options, see the analysis options reference pages.
How to create and use the object, see
polyspace.ModelLinkOptions
.
Each property description below also highlights if the option affects only one of Bug Finder or Code Prover.
Note
Some options might not be available depending on the language setting of the
object. You can set the source code language (Language
) to
'C'
, 'CPP'
or 'C-CPP'
during object creation, but cannot change it later.
Advanced
Additional
— Additional flags for analysis
character vector
Additional flags for analysis specified as a character vector.
For more information, see Other
.
Example: opts.Advanced.Additional = '-extra-flags -option
-extra-flags value'
PostAnalysisCommand
— Command or script software should execute after analysis finishes
character vector
Command or script software should execute after analysis finishes, specified as a character vector.
For more information, see Command/script to
apply after the end of the code verification (-post-analysis-command)
.
Example: opts.Advanced.PostAnalysisCommand = '"C:\Program
Files\perl\win32\bin\perl.exe" "C:\My_Scripts\send_email"'
BugFinderAnalysis (Affects Bug Finder Only)
CheckersList
— List of custom checkers to activate
polyspace.DefectsOptions
object | cell array of defect acronyms
This property affects Bug Finder analysis only.
List of custom checkers to activate
specified by using the name of a
polyspace.DefectsOptions
object or a cell array of defect acronyms. To use
this custom list in your analysis, set
CheckersPreset
to
custom
.
For more information, see polyspace.DefectsOptions
.
Example: defects =
polyspace.DefectsOptions;
opts.BugFinderAnalysis.CheckersList =
defects
Example: opts.BugFinderAnalysis.CheckersList
=
{'INT_ZERO_DIV','FLOAT_ZERO_DIV'}
CheckersPreset
— Subset of Bug Finder defects
'default'
(default) | 'all'
| 'custom'
This property affects Bug Finder analysis only.
Preset checker list, specified as a
character vector of one of the preset options:
'default'
,
'all'
,or
'custom'
. To use
'custom'
, specify a value for
the property
BugFinderAnalysis.CheckersList
.
For more information, see Find defects
(-checkers)
.
Example: opts.BugFinderAnalysis.CheckersPreset
= 'all'
ChecksUsingSystemInputValues
— Activate stricter checks for system inputs
false (default) | true
This property affects Bug Finder analysis only.
Activate stricter checks that consider all possible value for:
Global variables.
Reads of volatile variables.
Returns of stubbed functions.
Inputs to functions specified with SystemInputsFrom.
The analysis considers all possible values for a subset of Numerical and Static memory defects.
This property is equivalent to the Run stricter checks considering all values of system inputs check box in the Polyspace interface.
For more information, see Run stricter checks considering all values of
system inputs
(-checks-using-system-input-values)
.
Example: opts.BugFinderAnalysis.ChecksUsingSystemInputValues
= true
EnableCheckers
— Activate defect checking
true (default) | false
This property affects Bug Finder analysis only.
Activate defect checking, specified as true or false. Setting this property to false disables all defects. If you want to disable defect checking but still get results, turn on coding rules checking or code metric checking.
This property is equivalent to the Find defects check box in the Polyspace interface.
Example: opts.BugFinderAnalysis.EnableCheckers
= false
SystemInputsFrom
— List of functions for which you run stricter checks
'auto'
(default) | 'uncalled'
| 'all'
| 'custom'
This property affects Bug Finder analysis only.
Functions for which you want to run stricter checks that
consider all possible values of the function inputs. Specify
the list of functions as 'auto'
,
'uncalled'
,
'all'
, or as a character array
beginning with custom=
followed by a
comma-separated list of function names.
To enable this option, set
BugFinderAnalysis.ChecksUsingSystemInputValues
= true
.
For more information, see Consider inputs to these functions
(-system-inputs-from)
.
Example: opts.BugFinderAnalysis.SystemInputsFrom =
'custom=foo,bar'
ChecksAssumption (Affects Code Prover Only)
AllowNegativeOperandInShift
— Allow left shift operations on a negative number
true (default) | false
This property affects Code Prover analysis only.
Allow left shift operations on a negative number, specified as true or false.
For more information, see Allow
negative operand for left shifts
(-allow-negative-operand-in-shift)
.
Example: opts.ChecksAssumption.AllowNegativeOperandInShift =
true
AllowNonFiniteFloats
— Incorporate infinities and/or NaNs
false (default) | true
This property affects Code Prover analysis only.
Incorporate infinities and/or NaNs, specified as true or false.
For more information, see Consider
non finite floats (-allow-non-finite-floats)
.
Example: opts.ChecksAssumption.AllowNonFiniteFloats = true
AllowPtrArithOnStruct
— Allow arithmetic on pointer to a structure field so that it points to another field
false (default) | true
This property affects Code Prover analysis only.
Allow arithmetic on pointer to a structure field so that it points to another field, specified as true or false.
For more information, see Enable pointer arithmetic across fields
(-allow-ptr-arith-on-struct)
.
Example: opts.ChecksAssumption.AllowPtrArithOnStruct = true
CheckInfinite
— Detect floating-point operations that result in infinities
'allow'
(default) | 'warn-first'
| 'forbid'
This property affects Code Prover analysis only.
Detect floating-point operations that result in infinities.
To activate this option, specify
ChecksAssumption.AllowNonFiniteFloats
.
For more information, see Infinities (-check-infinite)
.
Example: opts.ChecksAssumption.CheckInfinite =
'forbid'
CheckNan
— Detect floating-point operations that result in NaN-s
'allow'
(default) | 'warn-first'
| 'forbid'
This property affects Code Prover analysis only.
Detect floating-point operations that result in NaN-s.
To activate this option, specify
ChecksAssumption.AllowNonFiniteFloats
.
For more information, see NaNs
(-check-nan)
.
Example: opts.ChecksAssumption.CheckNan =
'forbid'
CheckSubnormal
— Detect operations that result in subnormal floating point values
'allow'
(default) | 'warn-first'
| 'warn-all'
| 'forbid'
This property affects Code Prover analysis only.
Detect operations that result in subnormal floating point values.
For more information, see Subnormal detection mode (-check-subnormal)
.
Example: opts.ChecksAssumption.CheckSubnormal = 'forbid'
DetectPointerEscape
— Find cases where a function returns a pointer to one of its local variables
false (default) | true
This property affects Code Prover analysis only.
Find cases where a function returns a pointer to one of its local variables, specified as true or false.
For more information, see Detect
stack pointer dereference outside scope
(-detect-pointer-escape)
.
Example: opts.ChecksAssumption.DetectPointerEscape = true
DisableInitializationChecks
— Disable checks for noninitialized variables and pointers
false (default) | true
This property affects Code Prover analysis only.
Disable checks for noninitialized variables and pointers, specified as true or false.
For more information, see Disable
checks for non-initialization
(-disable-initialization-checks)
.
Example: opts.ChecksAssumption.DisableInitializationChecks =
true
PermissiveFunctionPointer
— Allow type mismatch between function pointers and the functions they point to
false (default) | true
This property affects Code Prover analysis only.
Allow type mismatch between function pointers and the functions they point to, specified as true or false.
For more information, see Permissive function pointer calls
(-permissive-function-pointer)
.
Example: opts.ChecksAssumption.PermissiveFunctionPointer =
true
SignedIntegerOverflows
— Behavior of signed integer overflows
'warn-with-wrap-around'
(default) | 'forbid'
| 'allow'
This property affects Code Prover analysis only.
Enable the check for signed integer overflows and the assumptions to make
following an overflow specified as 'forbid'
,
'allow'
, or 'warn-with-wrap-around'
.
For more information, see Overflow mode for signed integer
(-signed-integer-overflows)
.
Example: opts.ChecksAssumption.SignedIntegerOverflows =
'warn-with-wrap-around'
SizeInBytes
— Allow a pointer with insufficient memory buffer to point to a structure
false (default) | true
This property affects Code Prover analysis only.
Allow a pointer with insufficient memory buffer to point to a structure, specified as true or false.
For more information, see Allow
incomplete or partial allocation of structures
(-size-in-bytes)
.
Example: opts.ChecksAssumption.SizeInBytes = true
UncalledFunctionCheck
— Detect functions that are not called directly or indirectly from main or another entry-point function
'none'
(default) | 'never-called'
| 'called-from-unreachable'
| 'all'
This property affects Code Prover analysis only.
Detect functions that are not called directly or indirectly from main or another entry-point
function, specified as 'none'
, 'never-called'
,
'called-from-unreachable'
, or
'all'
.
For more information, see Detect
uncalled functions (-uncalled-function-checks)
.
Example: opts.ChecksAssumption.UncalledFunctionCheck = 'all'
UnsignedIntegerOverflows
— Behavior of unsigned integer overflows
'allow'
(default) | 'forbid'
| 'warn-with-wrap-around'
This property affects Code Prover analysis only.
Enable the check for unsigned integer overflows and the assumptions to make
following an overflow, specified as 'forbid'
,
'allow'
, or 'warn-with-wrap-around'
.
For more information, see Overflow mode for unsigned integer
(-unsigned-integer-overflows)
.
Example: opts.ChecksAssumption.UnsignedIntegerOverflows =
'allow'
CodeProverVerification (Affects Code Prover only)
ClassAnalyzer
— Classes that you want to verify
'none'
(default) | 'all'
| 'custom=class1[,class2,...]
'
class1[,class2,...]
'This property affects Code Prover analysis only.
Classes that you want to verify, specified as 'all'
,
'none'
, or as a character array beginning with
custom=
followed by a comma-separated list of class
names.
For more information, see Class (-class-analyzer)
.
Example: opts.CodeProverVerification.ClassAnalyzer =
'none'
FunctionsCalledAfterLoop
— Functions that the generated main must call after the cyclic code loop
cell array of function names
This property affects Code Prover analysis only.
Functions that the generated main must call after the cyclic code loop, specified as a cell array of function names.
For more information, see Termination functions
(-functions-called-after-loop)
.
Example: opts.CodeProverVerification.FunctionsCalledAfterLoop
= {'func1','func2'}
FunctionsCalledBeforeLoop
— Functions that the generated main must call before the cyclic code loop
cell array of function names
This property affects Code Prover analysis only.
Model Link only. Functions that the generated main must call before the cyclic code loop, specified as a cell array of function names.
For more information, see Initialization functions
(-functions-called-before-loop)
.
Example: opts.CodeProverVerification.FunctionsCalledBeforeLoop
= {'func1','func2'}
FunctionsCalledInLoop
— Functions that the generated main must call in the cyclic code loop
'none'
(default) | 'all'
| 'custom=function1[,function2,...]
'
function1[,function2,...]
'This property affects Code Prover analysis only.
Functions that the generated main must call in the cyclic code loop, specified as
'none'
, 'all'
, or as a character array
beginning with custom=
followed by a comma-separated list of
function names..
For more information, see Step functions (-functions-called-in-loop)
.
Example: opts.CodeProverVerification.FunctionsCalledInLoop
= 'all'
MainGenerator
— Generate a main function if it is not present in source files
true (default) | false
This property affects Code Prover analysis only.
Generate a main function if it is not present in source files, specified as true or false.
For more information, see Verify module or library
(-main-generator)
.
Example: opts.CodeProverVerification.MainGenerator =
false
VariablesWrittenBeforeLoop
— Variables that the generated main must initialize before the cyclic code loop
'none'
(default) | 'all'
| 'custom=variable1[,variable2,...]
'
variable1[,variable2,...]
'This property affects Code Prover analysis only.
Variables that the generated main must initialize before the cyclic code loop, specified as
'none'
, 'all'
, or as a character array
beginning with custom=
followed by a comma-separated list of
variable names.
For more information, see Parameters (-variables-written-before-loop)
.
Example: opts.CodeProverVerification.VariablesWrittenBeforeLoop
= 'all'
VariablesWrittenInLoop
— Variables that the generated main must initialize in the cyclic code loop
'none'
(default) | 'all'
| 'custom=variable1[,variable2,...]
'
variable1[,variable2,...]
'This property affects Code Prover analysis only.
Variables that the generated main must initialize in the cyclic code loop, specified as
'none'
, 'all'
, or as a character array
beginning with custom=
followed by a comma-separated list of
variable names.
For more information, see Inputs (-variables-written-in-loop)
.
Example: opts.CodeProverVerification.VariablesWrittenInLoop
= 'all'
CodingRulesCodeMetrics
AcAgcSubset
— Subset of MISRA AC AGC rules to check
'OBL-rules'
(default) | 'OBL-REC-rules'
| 'single-unit-rules'
| 'system-decidable-rules'
| 'all-rules'
| 'SQO-subset1'
| 'SQO-subset2'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA AC AGC rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA AC AGC (-misra-ac-agc)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA AC AGC rules, also set
EnableAcAgc
to true.
Example: opts.CodingRulesCodeMetrics.AcAgcSubset
= 'all-rules'
Data Types: char
AllowedPragmas
— Pragma directives for which MISRA C:2004 rule 3.4 or MISRA C++ 16-6-1 must not be applied
cell array of character vectors
Pragma directives for which MISRA C:2004 rule 3.4 or MISRA C++ 16-6-1 must not be applied, specified as a cell array of character vectors. This property affects only MISRA C:2004 or MISRA AC AGC rule checking.
For more information, see Allowed
pragmas (-allowed-pragmas)
.
Example: opts.CodingRulesCodeMetrics.AllowedPragmas
= {'pragma_01','pragma_02'}
Data Types: cell
AutosarCpp14
— Set of AUTOSAR C++ 14 rules to check
'all'
(default) | 'required'
| 'automated'
| polyspace.CodingRulesOptions
object | 'from-file'
This property affects Bug Finder only.
Set of AUTOSAR C++ 14 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check AUTOSAR C++ 14 security checks (-autosar-cpp14)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check AUTOSAR C++ 14 rules, also set EnableAutosarCpp14
to
true.
Example: opts.CodingRulesCodeMetrics.AutosarCpp14 = 'all'
Data Types: char
BooleanTypes
— Data types the coding rule checker must treat as effectively Boolean
cell array of character vectors
Data types that the coding rule checker must treat as effectively Boolean, specified as a cell array of character vectors.
For more information, see Effective
boolean types (-boolean-types)
.
Example: opts.CodingRulesCodeMetrics.BooleanTypes
= {'boolean1_t','boolean2_t'}
Data Types: cell
CertC
— Set of CERT® C rules and recommendations to check
'all'
(default) | 'publish-2016'
| 'all-rules'
| polyspace.CodingRulesOptions
object | 'from-file'
This property affects Bug Finder only.
Set of CERT C rules and recommendations to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check CERT-C security checks (-cert-c)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
from-file
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check CERT C rules and recommendations, also set EnableCertC
to
true.
Example: opts.CodingRulesCodeMetrics.CertC = 'all'
Data Types: char
CertCpp
— Set of CERT C++ rules to check
'all'
(default) | polyspace.CodingRulesOptions
object | 'from-file'
This property affects Bug Finder only.
Set of CERT C++ rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check CERT-C++ security checks (-cert-cpp)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check CERT C++ rules, also set EnableCertCpp
to true.
Example: opts.CodingRulesCodeMetrics.CertCpp = 'all'
Data Types: char
CheckersSelectionByFile
— File that defines custom set of coding standard checkers
full file path of .xml
file
File where you define a custom set of coding standards checkers to check, specified as a
.xml
file. You can, in the same file, define a custom set of checkers
for each of the coding standards that Polyspace supports. To create a file that defines a custom selection of coding standard
checkers, in the Polyspace interface, select a coding standard on the Coding
Standards & Code Metrics node of the Configuration
pane and click Edit.
For more information, see Set checkers by file
(-checkers-selection-file)
.
Example: opts.CodingRulesCodeMetrics.CheckersSelectionByFile =
'C:\ps_settings\coding_rules\custom_rules.xml'
Data Types: char
CodeMetrics
— Activate code metric calculations
false (default) | true
Activate code metric calculations, specified as true or false. If this property is turned off, Polyspace does not calculate code metrics even if you upload your results to Polyspace Metrics.
For more information about the code metrics,
see Calculate code
metrics (-code-metrics)
.
If you assign a coding rules options object to this property, an XML file gets created automatically with the rules specified.
Example: opts.CodingRulesCodeMetrics.CodeMetrics
= true
Cwe
— Set of CWE™ rules to check
'all'
(default) |
'cwe-658-659'
| 'from-file'
| polyspace.CodingRulesOptions
object
This property affects Bug Finder only.
Set of CWE rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check CWE (-cwe)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check CERT C++ rules, also set EnableCwe
to true.
Example: opts.CodingRulesCodeMetrics.Cwe =
'cwe-658-659'
Data Types: char
EnableAcAgc
— Check MISRA AC AGC rules
false (default) | true
Check MISRA AC AGC rules, specified as true or
false. To customize which rules are checked, use
AcAgcSubset
.
For more information about the MISRA AC AGC
checker, see Check MISRA AC
AGC (-misra-ac-agc)
.
Example: opts.CodingRulesCodeMetrics.EnableAcAgc
= true;
EnableAutosarCpp14
— Check AUTOSAR C++ 14 rules
false (default) | true
This property affects Bug Finder only.
Check AUTOSAR C++ 14 rules, specified as true or false. To customize which rules are
checked, use AutosarCpp14
.
For more information about the AUTOSAR C++ 14 checker, see Check AUTOSAR C++ 14
checks (-autosar-cpp14)
.
Example: opts.CodingRulesCodeMetrics.EnableAutosarCpp14 =
true;
EnableCertC
— check CERT C rules and recommendations
false (default) | true
This property affects Bug Finder only.
Check CERT C rules and recommendations, specified as true or false. To customize which
rules are checked, use CertC
.
For more information about the CERT C checker, see Check SEI CERT-C checks
(-cert-c)
.
Example: opts.CodingRulesCodeMetrics.EnableCertC = true;
EnableCertCpp
— check CERT C++ rules
false (default) | true
This property affects Bug Finder only.
Check CERT C++ rules, specified as true or false. To customize which rules are checked,
use CertCpp
.
For more information about the CERT C++ checker, see Check SEI-CERT-C++
(-cert-cpp)
.
Example: opts.CodingRulesCodeMetrics.EnableCertCpp = true;
EnableCheckersSelectionByFile
— Check custom set of coding standard checkers
false (default) | true
Check custom set of coding standard checkers, specified as true or false. If you set
this property to true, specify the path of checkers selection XML file for the property
CheckersSelectionByFile
and set one of these properties to
'from-file' to enable the corresponding coding standard custom set:
opts.CodingRulesCodeMetrics.AcAgcSubset='from-file'
opts.CodingRulesCodeMetrics.AutosarCpp14='from-file'
opts.CodingRulesCodeMetrics.CertC='from-file'
opts.CodingRulesCodeMetrics.CertCpp='from-file'
opts.CodingRulesCodeMetrics.Cwe='from-file'
opts.CodingRulesCodeMetrics.Guidelines='from-file'
opts.CodingRulesCodeMetrics.Iso17961='from-file'
opts.CodingRulesCodeMetrics.JsfSubset='from-file'
opts.CodingRulesCodeMetrics.MisraC3Subset='from-file'
opts.CodingRulesCodeMetrics.MisraCSubset='from-file'
opts.CodingRulesCodeMetrics.MisraCppSubset='from-file'
For more information, see Check
custom rules (-custom-rules)
.
Example: opts.CodingRulesCodeMetrics.EnableCheckersSelectionByFile =
true;
EnableCustomRules
— Check custom coding rules
false (default) | true
Check custom coding rules, specified as true
or false. The file you specify with CheckersSelectionByFile
defines the
custom coding rules.
Use with EnableCheckersSelectionByFile
.
For more information, see Check custom
rules (-custom-rules)
.
Example: opts.CodingRulesCodeMetrics.EnableCustomRules
= true;
EnableCwe
— check CWE rules
false (default) | true
This property affects Bug Finder only.
Check CWE rules, specified as true or false. To customize which rules are checked, use
Cwe
.
For more information about the CWE checker, see Check CWE
(-cwe)
.
Example: opts.CodingRulesCodeMetrics.Cwe = true;
EnableGuidelines
— Check for violations of coding guidelines
false (default) | true
This property affects Bug Finder only.
Specify whether to check for violations of Guidelines. To customize which rules are
checked, use Guidelines
.
For more information about the Guidelines checker, see Check guidelines
(-guidelines)
.
Example: opts.CodingRulesCodeMetrics.EnableGuidelines =
true;
EnableIso17961
— check ISO-17961 rules
false (default) | true
This property affects Bug Finder only.
Check ISO®/IEC TS 17961 rules, specified as true or false. To customize which rules are
checked, use Iso17961
.
For more information about the ISO-17961 checker, see Check ISO-17961
security checks (-iso-17961)
.
Example: opts.CodingRulesCodeMetrics.EnableIso17961 = true;
EnableJsf
— Check JSF C++ rules
false (default) | true
Check JSF C++ rules, specified as true or
false. To customize which rules are checked, use
JsfSubset
.
For more information, see Check JSF C++
rules (-jsf-coding-rules)
.
Example: opts.CodingRulesCodeMetrics.EnableJsf
= true;
EnableMisraC
— Check MISRA C:2004 rules
false (default) | true
Check MISRA C:2004 rules, specified as true or
false. To customize which rules are checked, use
MisraCSubset
.
For more information, see Check MISRA
C:2004 (-misra2)
.
Example: opts.CodingRulesCodeMetrics.EnableMisraC
= true;
EnableMisraC3
— Check MISRA C:2012 rules
false (default) | true
Check MISRA C:2012 rules, specified as true or
false. To customize which rules are checked, use
MisraC3Subset
.
For more information about the MISRA C:2012
checker, see Check MISRA
C:2012 (-misra3)
.
Example: opts.CodingRulesCodeMetrics.EnableMisraC3
= true;
EnableMisraC2023
— Check MISRA C:2023 rules
false (default) | true
Check MISRA C:2023 rules, specified as true or false. To customize which rules are
checked, use MisraC2023
.
For more information about the MISRA C:2023 checker, see Check MISRA C:2023
(-misra-c-2023)
.
Example: opts.CodingRulesCodeMetrics.EnableMisraC2023 =
true;
EnableMisraCpp
— Check MISRA C++:2008 rules
false (default) | true
Check MISRA C++:2008 rules, specified as true
or false. To customize which rules are checked,
use MisraCppSubset
.
For more information about the MISRA C++:2008
checker, see Check MISRA
C++ rules (-misra-cpp)
.
Example: opts.CodingRulesCodeMetrics.EnableMisraCpp
= true;
EnableMisraCpp2023
— Check MISRA C++:2023 rules
false (default) | true
Check MISRA C++:2023 rules, specified as true or false. To customize which rules are
checked, use MisraCppSubset
.
For more information about the MISRA C++:2023 checker, see Check MISRA C++:2023
(-misra-cpp-2023)
.
Example: opts.CodingRulesCodeMetrics.EnableMisraC2023 =
true;
Guidelines
— Set of Guidelines to check
'all'
(default) | 'his'
| 'from-file'
This property affects Bug Finder only.
Sets of Guideline rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check guidelines (-guidelines)
.An XML file specifying Guidelines checkers and their thresholds. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations.
Example: opts.CodingRulesCodeMetrics.Guidelines =
'his';
Iso17961
— Set of ISO-17961 rules to check
'all'
(default) | 'decidable'
| polyspace.CodingRulesOptions
object | 'from-file'
This property affects Bug Finder only.
Set of ISO/IEC TS 17961 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check ISO-17961 (-iso-17961)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check ISO/IEC TS 17961 rules, also set EnableIso17961
to
true.
Example: opts.CodingRulesCodeMetrics.Iso17961 = 'all'
Data Types: char
JsfSubset
— Subset of JSF C++ rules to check
'shall-rules'
(default) | 'shall-will-rules'
| 'all-rules'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of JSF C++ rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check JSF C++ rules (-jsf-coding-rules)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check JSF C++ rules, set
EnableJsf
to true.
Example: opts.CodingRulesCodeMetrics.JsfSubset
= 'all-rules'
Data Types: char
Misra3AgcMode
— Use the MISRA C:2012 categories for automatically generated code
false (default) | true
Use the MISRA C:2012 categories for automatically generated code, specified as true or false.
For more information, see Use
generated code requirements
(-misra3-agc-mode)
.
Example: opts.CodingRulesCodeMetrics.Misra3AgcMode
= true;
MisraC2023
— Subset of MISRA C:2023 rules to check
'mandatory-required'
(default) | 'mandatory'
| 'single-unit-rules'
| 'system-decidable-rules'
| 'all'
| 'SQO-subset1'
| 'SQO-subset2'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA C:2023 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA C:2023 (-misra-c-2023)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA C:2023 rules, also set EnableMisraC2023
to
true.
Example: opts.CodingRulesCodeMetrics.MisraC2023Subset =
'all'
Data Types: char
MisraC3Subset
— Subset of MISRA C:2012 rules to check
'mandatory-required'
(default) | 'mandatory'
| 'single-unit-rules'
| 'system-decidable-rules'
| 'all'
| 'SQO-subset1'
| 'SQO-subset2'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA C:2012 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA C:2012 (-misra3)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA C:2012 rules, also set
EnableMisraC3
to true.
Example: opts.CodingRulesCodeMetrics.MisraC3Subset
= 'all'
Data Types: char
MisraCSubset
— Subset of MISRA C:2004 rules to check
'required-rules'
(default) | 'single-unit-rules'
| 'system-decidable-rules'
| 'all-rules'
| 'SQO-subset1'
| 'SQO-subset2'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA C:2004 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA C:2004 (-misra2)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA C:2004 rules, also set
EnableMisraC
to true.
Example: opts.CodingRulesCodeMetrics.MisraCSubset
= 'all-rules'
Data Types: char
MisraCppSubset
— Subset of MISRA C++ :2008rules
'required-rules'
(default) | 'all-rules'
| 'SQO-subset1'
| 'SQO-subset2'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA C++:2008 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA C++ rules (-misra-cpp)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA C++ rules, set EnableMisraCpp
to true.
Example: opts.CodingRulesCodeMetrics.MisraCppSubset =
'all-rules'
Data Types: char
MisraCpp2023
— Subset of MISRA C++ :2023rules
'mandatory-required'
(default) | 'mandatory'
| single-unit-rules'
| 'system-decidable-rules'
| 'all'
| polyspace.CodingRulesOptions
object | 'from-file'
Subset of MISRA C++:2023 rules to check, specified by:
Character vector of one of the subset names. For more information about the different subsets, see
Check MISRA C++:2023 (-misra-cpp-2023)
.A coding rules options object. To create a coding rules options object, see
polyspace.CodingRulesOptions
.An XML file specifying coding standard checkers. Use
'from-file'
for this property and then use theEnableCheckersSelectionByFile
andCheckersSelectionByFile
property to specify the full path to the file where you define a custom subset of checkers.You can create this file manually or in the Polyspace interface. See Check for and Review Coding Standard Violations. If you assign a coding rules options object to this property, an XML file is created automatically and assigned to the
CheckersSelectionByFile
property. The XML file enables rules extracted from the coding rules options object.
To check MISRA C++ rules, set EnableMisraCpp2023
to true.
Example: opts.CodingRulesCodeMetrics.MisraCpp2023 =
'all-rules'
Data Types: char
EnvironmentSettings
Dos
— Consider that file paths are in MS-DOS style
true (default) | false
Consider that file paths are in MS-DOS style, specified as true or false.
For more information, see Code from DOS or Windows
file system (-dos)
.
Example: opts.EnvironmentSettings.Dos = true;
IncludeFolders
— Include folders needed for compilation
cell array of include folder paths
Include folders needed for compilation, specified as a cell array of the include folder paths.
To specify all subfolders of a folder, use folder path followed
by **
, for instance,
'C:\includes\**'
. The notation
follows the syntax of the dir
function.
See
also Specify Multiple Source Files.
For more information, see -I
.
Example: opts.EnvironmentSettings.IncludeFolders = {'/includes','/com1/inc'};
Example: opts.EnvironmentSettings.IncludeFolders = {'C:\project1\common\includes'};
Data Types: cell
Includes
— Files to be #include
-ed by each C file
cell array of files
Files to be #include
-ed by each C source
file in the analysis, specified by a cell array of files.
For more information, see Include (-include)
.
Example: opts.EnvironmentSettings.Includes =
{'/inc/inc_file.h','/inc/inc_math.h'}
NoExternC
— Ignore linking errors inside extern blocks
false (default) | true
Ignore linking errors inside extern blocks, specified as true or false.
For more information, see Ignore link errors
(-no-extern-c)
.
Example: opts.EnvironmentSettings.NoExternC = false;
PostPreProcessingCommand
— Command or script to run on source files after preprocessing
character vector
Command or script to run on source files after preprocessing, specified as a character vector of the command to run.
For more information, see Command/script to apply to preprocessed
files (-post-preprocessing-command)
.
Example: Linux — opts.EnvironmentSettings.PostPreProcessingCommand =
[pwd,'/replace_keyword.pl']
Example: Windows
— opts.EnvironmentSettings.PostPreProcessingCommand
= '"C:\Program Files\MATLAB\R2015b\sys\perl\win32\bin\perl.exe" "C:\My_Scripts\replace_keyword.pl"'
SourcesEncoding
— Specify the encoding of source files
'system'
(default) | 'shift-jis'
| 'iso-8859-1'
| 'windows-1252'
| 'utf-8'
Specify the encoding of your source files. Specifying the source encoding allows Polyspace to correctly interpret non-ASCII characters.
For more information, see Source code encoding
(-sources-encoding)
.
Example: opts.EnvironmentSettings.SourcesEncoding =
'utf-8';
StopWithCompileError
— Stop analysis if a file does not compile
false (default) | true
Stop analysis if a file does not compile, specified as true or false.
For more information, see Stop analysis if a file
does not compile
(-stop-if-compile-error)
.
Example: opts.EnvironmentSettings.StopWithCompileError
= true;
InputsStubbing
DataRangeSpecifications
— Constrain global variables, function inputs, and return values of stubbed functions
file path
Constrain global variables, function inputs, and return values of stubbed functions specified by the path to an XML constraint file. For more information about the constraint file, see Specify External Constraints for Polyspace Analysis.
For more information about this option, see Constraint setup (-data-range-specifications)
.
Example: opts.InputsStubbing.DataRangeSpecifications
= 'C:\project\constraint_file.xml'
DoNotGenerateResultsFor
— Files on which you do not want analysis results
'include-folders'
(default) | 'all-headers'
| 'custom=folder1[,folder2,...]
'
folder1[,folder2,...]
'Files on which you do not want analysis results, specified by
'include-folders'
, 'all-headers'
, or a
character array beginning with custom=
followed by a
comma-separated list of file or folder names.
Use this option with InputsStubbing.GenerateResultsFor
.
For more information, see Do not generate results
for (-do-not-generate-results-for)
.
Example: opts.InputsStubbing.DoNotGenerateResultsFor =
'custom=C:\project\file1.c,C:\project\file2.c'
GenerateResultsFor
— Files on which you want analysis results
'source-headers'
(default) | 'all-headers'
| 'custom=folder1[,folder2,...]
'
folder1[,folder2,...]
'Files on which you want analysis results, specified by 'source-headers'
,
'all-headers'
, or a character array beginning with
custom=
followed by a comma-separated list of file or folder
names.
Use this option with InputsStubbing.DoNotGenerateResultsFor
.
For more information, see Generate results for
sources and (-generate-results-for)
.
Example: opts.InputsStubbing.GenerateResultsFor =
'custom=C:\project\includes_common_1,C:\project\includes_common_2'
FunctionsToStub
— Functions to stub during analysis
cell array of function names
This property affects Code Prover analysis only.
Functions to stub during analysis, specified as a cell array of function names.
For more information, see Functions to stub
(-functions-to-stub)
.
Example: opts.InputsStubbing.FunctionsToStub = {'func1',
'func2'}
NoDefInitGlob
— Consider global variables as uninitialized
false (default) | true
This property affects Code Prover analysis only.
Consider global variables as uninitialized, specified as true or false.
For more information, see Ignore default initialization of global
variables (-no-def-init-glob)
.
Example: opts.InputsStubbing.NoDefInitGlob = true
StubECoderLookupTables
— Specify that the analysis must stub functions in the generated code that use lookup tables
true (default) | false
This property applies only to a Code Prover analysis of code generated from models.
Specify that the analysis must stub functions in the generated code that use lookup tables. By replacing the functions with stubs, the analysis assumes more precise return values for the functions.
For more information, see Generate stubs for Embedded Coder lookup
tables (-stub-embedded-coder-lookup-table-functions)
.
Example: opts.InputsStubbing.StubECoderLookupTables
= true
Macros
DefinedMacros
— Macros to be replaced
cell array of macros
In preprocessed code, macros are replaced by the definition,
specified in a cell array of macros and definitions. Specify the macro
as Macro=Value
. If you want Polyspace to ignore
the macro, leave the Value
blank. A macro with
no equal sign replaces all
instances of that macro by 1.
For more information, see Preprocessor definitions
(-D)
.
Example: opts.Macros.DefinedMacros = {'uint32=int','name3=','var'}
UndefinedMacros
— Macros to undefine
cell array of macros
In preprocessed code, macros are undefined, specified by a cell array of macros to undefine.
For more information, see Disabled preprocessor
definitions (-U)
.
Example: opts.Macros.DefinedMacros = {'name1','name2'}
MergedComputingSettings
BatchBugFinder
— Send Bug Finder analysis to remote server
false (default) | true
This property affects Bug Finder analysis only.
Send Bug Finder analysis to remote server, specified as true or false. To use this option, in your Polyspace preferences, you must specify a metrics server.
For more information, see:
Example: opts.MergedComputingSettings.BatchBugFinder = true;
BatchCodeProver
— Send Code Prover analysis to remote server
false (default) | true
This property affects Code Prover analysis only.
Send Code Prover analysis to remote server, specified as true or false. To use this option, in your Polyspace preferences, you must specify a metrics server.
For more information, see:
Example: opts.MergedComputingSettings.BatchCodeProver = true;
FastAnalysis
— Run Bug Finder analysis using faster local mode
false (default) | true
This property affects Bug Finder analysis only.
Use fast analysis mode for Bug Finder analysis, specified as true or false.
For more information, see Use fast
analysis mode for Bug Finder
(-fast-analysis)
.
Example: opts.MergedComputingSettings.FastAnalysis = true;
MergedReporting
EnableReportGeneration
— Generate a report after the analysis
false (default) | true
After the analysis, generate a report, specified as true or false.
For more information, see Generate
report
.
Example: opts.MergedReporting.EnableReportGeneration
= true
ReportOutputFormat
— Output format of generated report
'Word'
(default) | 'HTML'
| 'PDF'
Output format of generated report, specified
as one of the report formats. To activate this
option, specify
Reporting.EnableReportGeneration
.
For more information about the different
values, see Output format
(-report-output-format)
.
Example: opts.MergedReporting.ReportOutputFormat
= 'PDF'
BugFinderReportTemplate
— Template for generating Bug Finder analysis report
'BugFinderSummary'
(default) | 'BugFinder'
| 'SecurityCWE'
| 'CodeMetrics'
| 'CodingStandards'
This property affects a Bug Finder analysis only.
Template for generating analysis report,
specified as one of the report formats. To
activate this option, specify
Reporting.EnableReportGeneration
.
For more information about the different
values, see Bug Finder and Code Prover report
(-report-template)
.
Example: opts.MergedReporting.BugFinderReportTemplate
= 'CodeMetrics'
CodeProverReportTemplate
— Template for generating Code Prover analysis report
'Developer'
(default) | 'CallHierarchy'
| 'CodeMetrics'
| 'CodingStandards'
| 'DeveloperReview'
| 'Developer_withGreenChecks'
| 'Quality'
| 'VariableAccess'
This property affects a Code Prover analysis only.
Template for generating analysis report,
specified as one of the predefined report formats.
To activate this option, specify
Reporting.EnableReportGeneration
.
For more information about the different
values, see Bug Finder and Code Prover report
(-report-template)
.
Example: opts.MergedReporting.CodeProverReportTemplate
= 'CodeMetrics'
Multitasking
ArxmlMultitasking
— Specify path of ARXML files to parse for multitasking configuration
cell array of file paths
Specify the path to the ARXML files the software parses to set up your multitasking configuration.
To activate this option, specify
Multitasking.EnableExternalMultitasking
and set
Multitasking.ExternalMultitaskingType
to
autosar
.
For more information, see ARXML files selection
(-autosar-multitasking)
Example: opts.Multitasking.ArxmlMultitasking={'C:\Polyspace_Workspace\AUTOSAR\myFile.arxml'}
CriticalSectionBegin
— Functions that begin critical sections
cell array of critical section function names
Functions that begin critical sections specified as a cell array of critical
section function names. To activate this option, specify
Multitasking.EnableMultitasking
and
Multitasking.CriticalSectionEnd
.
For more information, see Critical section details
(-critical-section-begin -critical-section-end)
.
Example: opts.Multitasking.CriticalSectionBegin =
{'function1:cs1','function2:cs2'}
CriticalSectionEnd
— Functions that end critical sections
cell array of critical section function names
Functions that end critical sections specified as a cell array of critical section
function names. To activate this option, specify
Multitasking.EnableMultitasking
and
Multitasking.CriticalSectionBegin
.
For more information, see Critical section details
(-critical-section-begin -critical-section-end)
.
Example: opts.Multitasking.CriticalSectionEnd =
{'function1:cs1','function2:cs2'}
CyclicTasks
— Specify functions that represent cyclic tasks
cell array of function names
Specify functions that represent cyclic tasks.
To activate this option, also specify
Multitasking.EnableMultitasking
.
For more information, see Cyclic tasks
(-cyclic-tasks)
.
Example: opts.Multitasking.CyclicTasks =
{'function1','function2'}
EnableConcurrencyDetection
— Enable automatic detection of certain families of threading functions
false (default) | true
This property affects Code Prover analysis only.
Enable automatic detection of certain families of threading functions, specified as true or false.
For more information, see Enable automatic concurrency detection for
Code Prover (-enable-concurrency-detection)
.
Example: opts.Multitasking.EnableConcurrencyDetection =
true
EnableExternalMultitasking
— Enable automatic multitasking configuration from external file definitions
false (default) | true
Enable multitasking configuration of your projects from external files you provide. Configure multitasking from ARXML files for an AUTOSAR project, or from OIL files for an OSEK project.
Activate this option to enable
Multitasking.ArxmlMultitasking
or
Multitasking.OsekMultitasking
.
For more information, see OIL files selection (-osek-multitasking)
and ARXML files selection
(-autosar-multitasking)
.
Example:
opts.Multitasking.EnableExternalMultitasking = 1
EnableMultitasking
— Configure multitasking manually
false (default) | true
Configure multitasking manually by specifying true
. This
property activates the other manual, multitasking properties.
For more information, see Configure multitasking
manually
.
Example: opts.Multitasking.EnableMultitasking = 1
EntryPoints
— Functions that serve as entry-points to your multitasking application
cell array of entry-point function names
Functions that serve as entry-points to your multitasking application specified as
a cell array of entry-point function names. To activate this option, also specify
Multitasking.EnableMultitasking
.
For more information, see Tasks (-entry-points)
.
Example: opts.Multitasking.EntryPoints =
{'function1','function2'}
ExternalMultitaskingType
— Specify type of file to parse for multitasking configuration
'osek'
(default) | 'autosar'
Specify the type of file the software parses to set up your multitasking configuration:
For
osek
type, the analysis looks for OIL files in the file or folder paths that you specify.For
autosar
type, the analysis looks for ARXML files in the file paths that you specify.
To activate this option, specify
Multitasking.EnableExternalMultitasking
.
For more information, see OIL files selection (-osek-multitasking)
and ARXML files selection
(-autosar-multitasking)
.
Example:
opts.Multitasking.ExternalMultitaskingType =
'autosar'
Interrupts
— Specify functions that represent nonpreemptable interrupts
cell array of function names
Specify functions that represent nonpreemptable interrupts.
To activate this option, specify
Multitasking.EnableMultitasking
.
For more information, see Interrupts
(-interrupts)
.
Example: opts.Multitasking.Interrupts =
{'function1','function2'}
InterruptsDisableAll
— Specify routine that disable interrupts
cell array with one function name
This property affects Bug Finder analysis only.
Specify function that disables all interrupts.
To activate this option, specify
Multitasking.EnableMultitasking
.
For more information, see Disabling all interrupts (-routine-disable-interrupts
-routine-enable-interrupts)
.
Example: opts.Multitasking.InterruptsDisableAll =
{'function'}
InterruptsEnableAll
— Specify routine that reenable interrupts
cell array with one function name
This property affects Bug Finder analysis only.
Specify function that reenables all interrupts.
To activate this option, specify
Multitasking.EnableMultitasking
.
For more information, see Disabling all interrupts (-routine-disable-interrupts
-routine-enable-interrupts)
.
Example: opts.Multitasking.InterruptsEnableAll =
{'function'}
OsekMultitasking
— Specify path of OIL files to parse for multitasking configuration
'auto'
(default) | 'custom=folder1[,folder2,...]
'
folder1[,folder2,...]
'Specify the path to the OIL files the software parses to set up your multitasking configuration:
In the mode specified with
'auto'
, the analysis uses OIL files in your project source and include folders, but not their subfolders.In the mode specified with
'custom=
, the analysis uses the OIL files at the specified path, and the path subfolders.folder1[,folder2,...]
'
To activate this option, specify
Multitasking.EnableExternalMultitasking
and set
Multitasking.ExternalMultitaskingType
to
osek
.
For more information, see OIL files selection
(-osek-multitasking)
Example:
opts.Multitasking.OsekMultitasking = 'custom=file_path,
dir_path'
TemporalExclusion
— Entry-point functions that cannot execute concurrently
cell array of entry-point function names
Entry-point functions that cannot execute concurrently specified as a cell array
of entry-point function names. Each set of exclusive tasks is one cell array entry
with functions separated by spaces. To activate this option, specify
Multitasking.EnableMultitasking
.
For more information, see Temporally exclusive tasks
(-temporal-exclusions-file)
.
Example: opts.Multitasking.TemporalExclusion = {'function1 function2',
'function3 function4 function5'}
where function1 and function2 are
temporally exclusive, and function3, function4, and function 5 are temporally
exclusive.
Precision (Affects Code Prover Only)
ContextSensitivity
— Store call context information to identify function call that caused errors
'none'
(default) | 'auto'
| 'custom=function1[,function2,...]
'
function1[,function2,...]
'This property affects Code Prover analysis only.
Store call context information to identify a function call that caused errors, specified as
none
, auto
, or as a character array
beginning with custom=
followed by a list of comma-separated
function names.
For more information, see Sensitivity context (-context-sensitivity)
.
Example: opts.Precision.ContextSensitivity = 'auto'
Example: opts.Precision.ContextSensitivity = 'custom=func1'
ModulesPrecision
— Source files you want to verify at higher precision
cell array of file names and precision levels
This property affects Code Prover analysis only.
Source files that you want to verify at higher precision, specified
as a cell array of file names without the extension and precision
levels using this syntax: filename
:Olevel
For more information, see Specific precision (-modules-precision)
.
Example: opts.Precision.ModulesPrecision = {'file1:O0',
'file2:O3'}
OLevel
— Precision level for the verification
2 (default) | 0 | 1 | 3
This property affects Code Prover analysis only.
Precision level for the verification, specified as 0, 1, 2, or 3.
For more information, see Precision level (-O)
.
Example: opts.Precision.OLevel = 3
PathSensitivityDelta
— Avoid certain verification approximations for code with fewer lines
positive integer
This property affects Code Prover analysis only.
Avoid certain verification approximations for code with fewer lines, specified as a positive integer representing how sensitive the analysis is. Higher values can increase verification time exponentially.
For more information, see Improve precision of interprocedural analysis
(-path-sensitivity-delta)
.
Example: opts.Precision.PathSensitivityDelta = 2
Timeout
— Time limit on your verification
character vector
This property affects Code Prover analysis only.
Time limit on your verification, specified as a character vector of time in hours.
For more information, see Verification time limit (-timeout)
.
Example: opts.Precision.Timeout = '5.75'
To
— Number of times the verification process runs
'Software Safety Analysis level 2'
(default) | 'Software Safety Analysis level 0'
| 'Software Safety Analysis level 1'
| 'Software Safety Analysis level 3'
| 'Software Safety Analysis level 4'
| 'Source Compliance Checking'
| 'other'
This property affects Code Prover analysis only.
Number of times the verification process runs, specified as one of the preset analysis levels.
For more information, see Verification level (-to)
.
Example: opts.Precision.To = 'Software Safety Analysis
level 3'
Scaling (Affects Code Prover Only)
Inline
— Functions on which separate results must be generated for each function call
cell array of function names
This property affects Code Prover analysis only.
Functions on which separate results must be generated for each function call, specified as a cell array of function names.
For more information, see Inline
(-inline)
.
Example: opts.Scaling.Inline = {'func1','func2'}
KLimiting
— Limit depth of analysis for nested structures
positive integer
This property affects Code Prover analysis only.
Limit depth of analysis for nested structures, specified as a positive integer indicating how many levels into a nested structure to verify.
For more information, see Depth of
verification inside structures
(-k-limiting)
.
Example: opts.Scaling.KLimiting = 3
TargetCompiler
Compiler
— Compiler that builds your source code
'generic'
(default) | 'gnu3.4'
| 'gnu4.6'
| 'gnu4.7'
| 'gnu4.8'
| 'gnu4.9'
| 'gnu5.x'
| 'gnu6.x'
| 'gnu7.x'
| 'clang3.x'
| 'clang4.x'
| 'clang5.x'
| 'visual9.0'
| 'visual10'
| 'visual11.0'
| 'visual12.0'
| 'visual14.0'
| 'visual15.x'
| 'keil'
| 'iar'
| 'armcc'
| 'armclang'
| 'codewarrior'
| 'diab'
| 'greenhills'
| 'iar-ew'
| 'renesas'
| 'tasking'
| 'ti'
Compiler that builds your source code.
For more information, see Compiler (-compiler)
.
Example: opts.TargetCompiler.Compiler =
'Visual11.0'
CppVersion
— Specify C++ standard version followed in code
'defined-by-compiler'
(default) | 'cpp03'
| 'cpp11'
| 'cpp14'
| 'cpp17'
Specify C++ standard version followed in code, specified as a character vector.
For more information, see C++ standard version
(-cpp-version)
.
Example: opts.TargetCompiler.CppVersion =
'cpp11';
CVersion
— Specify C standard version followed in code
'defined-by-compiler'
(default) | 'c90'
| 'c99'
| 'c11'
Specify C standard version followed in code, specified as a character vector.
For more information, see C standard version (-c-version)
.
Example: opts.TargetCompiler.CVersion = 'c90';
DivRoundDown
— Round down quotients from division or modulus of negative numbers
false (default) | true
Round down quotients from division or modulus of negative numbers, specified as true or false.
For more information, see Division round down
(-div-round-down)
.
Example: opts.TargetCompiler.DivRoundDown = true
EnumTypeDefinition
— Base type representation of enum
'defined-by-compiler'
(default) | 'auto-signed-first'
| 'auto-unsigned-first'
Base type representation of enum, specified by an allowed base-type set. For more
information about the different values, see Enum type definition
(-enum-type-definition)
.
Example: opts.TargetCompiler.EnumTypeDefinition =
'auto-unsigned-first'
IgnorePragmaPack
— Ignore #pragma pack directives
false (default) | true
Ignore #pragma pack directives, specified as true or false.
For more information, see Ignore pragma pack directives
(-ignore-pragma-pack)
.
Example: opts.TargetCompiler.IgnorePragmaPack =
true
Language
— Language of analysis
'C-CPP'
(default) | 'C'
| 'CPP'
This property is read-only.
Language of the analysis, specified during the object construction. This value changes which properties appear.
For more information, see Source code language
(-lang)
.
LogicalSignedRightShift
— Treatment of signed bit on signed variables
'Arithmetical'
(default) | 'Logical'
Treatment of signed bit on signed variables, specified as
Arithmetical
or Logical
. For more
information, see Signed right shift
(-logical-signed-right-shift)
.
Example: opts.TargetCompiler.LogicalSignedRightShift =
'Logical'
NoUliterals
— Do not use predefined typedefs for char16_t or char32_t
false (default) | true
Do not use predefined typedefs for char16_t or char32_t, specified as true or
false. For more information, see Block char16/32_t types
(-no-uliterals)
.
Example: opts.TargetCompiler.NoUliterals = true
PackAlignmentValue
— Default structure packing alignment
'defined-by-compiler'
(default) | '1'
| '2'
| '4'
| '8'
| '16'
Default structure packing alignment, specified as
'defined-by-compiler'
, '1'
,
'2'
, '4'
, '8'
, or
'16'
. This property is available only for Visual C++
code.
For more information, see Pack alignment value
(-pack-alignment-value)
.
Example: opts.TargetCompiler.PackAlignmentValue =
'4'
SfrTypes
— sfr types
cell array of sfr
keywords
sfr
types, specified as a cell array of sfr
keywords using the syntax
.
For more information, see sfr_name
=size_in_bits
Sfr type support
(-sfr-types)
.
This option only applies when you set TargetCompiler.Compiler
to keil
or iar
.
Example: opts.TargetCompiler.SfrTypes =
{'sfr32=32'}
SizeTTypeIs
— Underlying type of size_t
'defined-by-compiler'
(default) | 'unsigned-int'
| 'unsigned-long'
| 'unsigned-long-long'
Underlying type of size_t
, specified as
'defined-by-compiler'
, 'unsigned-int'
,
'unsigned-long'
, or 'unsigned-long-long'
.
See Management of
size_t (-size-t-type-is)
.
Example: opts.TargetCompiler.SizeTTypeIs =
'unsigned-long'
Target
— Target processor
'i386'
(default) | 'arm'
| 'arm64'
| 'avr'
| 'c-167'
| 'c166'
| 'c18'
| 'c28x'
| 'c6000'
| 'coldfire'
| 'hc08'
| 'hc12'
| 'm68k'
| 'mcore'
| 'mips'
| 'mpc5xx'
| 'msp430'
| 'necv850'
| 'powerpc'
| 'powerpc64'
| 'rh850'
| 'rl78'
| 'rx'
| 's12z'
| 'sharc21x61'
| 'sparc'
| 'superh'
| 'tms320c3x'
| 'tricore'
| 'x86_64'
| generic target object
Set size of data types and endianness of processor, specified as one of the predefined target processors or a generic target object.
For more information about the predefined processors, see Target processor type
(-target)
.
For more information about creating a generic target, see polyspace.GenericTargetOptions
.
Example: opts.TargetCompiler.Target = 'hc12'
WcharTTypeIs
— Underlying type of wchar_t
'defined-by-compiler'
(default) | 'signed-short'
| 'unsigned-short'
| 'signed-int'
| 'unsigned-int'
| 'signed-long'
| 'unsigned-long'
Underlying type of wchar_t
, specified as
'defined-by-compiler'
, 'signed-short'
,
'unsigned-short'
, 'signed-int'
,
'unsigned-int'
, 'signed-long'
, or
'unsigned-long'
. See Management of
wchar_t (-wchar-t-type-is)
.
Example: opts.TargetCompiler.WcharTTypeIs =
'unsigned-int'
VerificationAssumption (Affects Code Prover Only)
ConsiderVolatileQualifierOnFields
— Assume that volatile qualified structure fields can have all possible values at any point in code
false (default) | true
This property affects Code Prover analysis only.
Assume that volatile qualified structure fields can have all possible values at any point in code.
For more information, see Consider
volatile qualifier on fields
(-consider-volatile-qualifier-on-fields)
.
Example: opts.VerificationAssumption.ConsiderVolatileQualifierOnFields =
true
ConstraintPointersMayBeNull
— Specify that environment pointers can be NULL unless constrained otherwise
false (default) | true
This property affects Code Prover analysis only.
Specify that environment pointers can be NULL unless constrained otherwise.
For more information, see Consider
environment pointers as unsafe
(-stubbed-pointers-are-unsafe)
.
Example: opts.VerificationAssumption.ConstraintPointersMayBeNull =
true
FloatRoundingMode
— Rounding modes to consider when determining the results of floating-point arithmetic
to-nearest
(default) | all
This property affects Code Prover analysis only.
Rounding modes to consider when determining the results of floating-point
arithmetic, specified as to-nearest
or all
.
For more information, see Float rounding
mode (-float-rounding-mode)
.
Example: opts.VerificationAssumption.FloatRoundingMode =
'all'
Other Properties
Author
— Project author
username of current user (default) | character vector
Name of project author, specified as a character vector.
For more information, see -author
.
Example: opts.Author = 'JaneDoe'
ImportComments
— Import comments and justifications from previous analysis
character vector
To import comments and justifications from a previous analysis, specify the path to the results folder of the previous analysis.
You can also point to a previous results folder to see only new results compared to the previous run. See Compare Results from Different Polyspace Runs by Using MATLAB Scripts.
For more information, see -import-comments
Example: opts.ImportComments =
fullfile(polyspaceroot,'polyspace','examples','cxx','Bug_Finder_Example','Module_1','BF_Result')
Prog
— Project name
PolyspaceProject
(default) | character vector
Project name, specified as a character vector.
For more information, see -prog
.
Example: opts.Prog = 'myProject'
ResultsDir
— Location to store results
folder path
Location to store results, specified as a folder path. By default, the results are stored in the current folder.
For more information, see -results-dir
.
You can also create a separate results folder for each new run. See Compare Results from Different Polyspace Runs by Using MATLAB Scripts.
Example: opts.ResultsDir = 'C:\project\myproject\results\'
Sources
— Source files
cell array of files
Source files to analyze, specified as a cell array of files.
To specify all files in a folder, use folder path followed by
*
, for instance, 'C:\src\*'
. To specify all
files in a folder and its subfolders, use folder path followed by
**
, for instance, 'C:\src\**'
. The
notation follows the syntax of the dir
function. See also Specify Multiple Source Files.
For more information, see -sources
.
Example: opts.Sources = {'file1.c', 'file2.c', 'file3.c'}
Example: opts.Sources = {'project/src1/file1.c', 'project/src2/file2.c',
'project/src3/file3.c'}
Version
— Project version number
'1.0'
(default) | character array of a number
Version number of project, specified as a character array of a number. This option is useful if you upload your results to Polyspace Metrics. If you increment version numbers each time that you reanalyze your object, you can compare the results from two versions in Polyspace Metrics.
For more information, see -v[ersion]
.
Example: opts.Version = '2.3'
Version History
Introduced in R2017a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)