coder.setupMISRAConfig(cfg) sets up an
Embedded Coder® code generation configuration object with properties selected to
improve the generated code compliance with MISRA® C:2012 and MISRA C++:2008 guidelines.
Configure Code Generation Configuration Object for Improved MISRA Compliance
Create an Embedded Coder code generation configuration
object.
cfg = coder.config('lib', 'ecoder', true);
Set properties that might impact MISRA compliance.
coder.setupMISRAConfig(cfg);
The function coder.setupMISRAConfig sets property
values according to the values shown in the table.
Property
Value for Improved MISRA Compliance
CastingMode
'Standards'
CppNamespace
Valid namespace name for C++
DataTypeReplacement
'CoderTypedefs'
DynamicMemoryAllocation
'Off'
EnableRuntimeRecursion
false
EnableSignedLeftShifts
false
EnableSignedRightShifts
false
GenerateDefaultInSwitch
true
ParenthesesLevel
'Maximum'
TargetLangStandard
'C99 (ISO)' for C, 'C++03
(ISO)' for C++
If the CppNamespace property is unset, and the
TargetLang property is 'C++', then
coder.setupMISRAConfig sets the
CppNamespace property to a default character vector,
'Codegen'. Modify this value to a namespace name that
is particular to your project.
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.