MISRA 2012 Mapping to CodeSonar®

Relationship CodeSonar Class Category ID Category Name CodeSonar Class Mnemonic Type (category Name to class) Language extensions should Misra2012:1.2 LANG.COMM.CPP C++ Comment in C closely mapped not be used Language extensions should Misra2012:1.2 LANG.EXT.GNU GNU Extension closely mapped not be used Language extensions should Misra2012:1.2 LANG.EXT.TYPEOF GNU Typeof closely mapped not be used Language extensions should Misra2012:1.2 LANG.EXT.MS Microsoft Extension closely mapped not be used A project shall not contain Misra2012:2.1 LANG.STRUCT.UC Unreachable Call closely mapped unreachable code A project shall not contain Unreachable Misra2012:2.1 LANG.STRUCT.UC closely mapped unreachable code Computation A project shall not contain Unreachable Misra2012:2.1 LANG.STRUCT.UC closely mapped unreachable code Conditional A project shall not contain Unreachable Control Misra2012:2.1 LANG.STRUCT.UC closely mapped unreachable code Flow A project shall not contain Unreachable Data Misra2012:2.1 LANG.STRUCT.UC closely mapped unreachable code Flow Function Call Has Misra2012:2.2 There shall be no dead code MISC.NOEFFECT closely mapped No Effect Misra2012:2.2 There shall be no dead code LANG.STRUCT.UUVAL Unused Value closely mapped

Misra2012:2.2 There shall be no dead code LANG.STRUCT.UA Useless Assignment closely mapped A project should not contain Misra2012:2.3 LANG.STRUCT.UUTYPE Unused Type closely mapped unused type declarations A project should not contain Misra2012:2.4 LANG.STRUCT.UUTAG Unused Tag closely mapped unused tag declarations A project should not contain Misra2012:2.5 LANG.STRUCT.UUMACRO Unused Macro closely mapped unused macro declarations A function should not contain Misra2012:2.6 LANG.STRUCT.UULABEL Unused Label closely mapped unused label declarations There should be no unused Misra2012:2.7 LANG.STRUCT.UUPARAM Unused Parameter closely mapped parameters in functions The character sequences /* Misra2012:3.1 and // shall not be used within LANG.COMM.NEST.CSTYLE /* in Comment closely mapped a comment The character sequences /* LANG.COMM.NEST.CPPSTYL Misra2012:3.1 and // shall not be used within // in Comment closely mapped E a comment Line-splicing shall not be Line Splicing in Misra2012:3.2 LANG.COMM.SPLICE closely mapped used in // comments Comment Misra2012:4.2 Trigraphs should not be used LANG.STRUCT.TRIGRAPH Trigraph closely mapped Non-distinct External identifiers shall be Misra2012:5.1 LANG.ID.ND.EXT Identifiers: External closely mapped distinct Names Identifiers declared in the Non-distinct Misra2012:5.2 same scope and name space LANG.ID.ND.SS Identifiers: Same closely mapped shall be distinct Scope

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

An identifier declared in an Non-distinct inner scope shall not hide an Misra2012:5.3 LANG.ID.ND.NEST Identifiers: Nested closely mapped identifier declared in an outer Scope scope Non-distinct Macro identifiers shall be Misra2012:5.4 LANG.ID.ND.MM Identifiers: closely mapped distinct Macro/Macro Non-distinct Identifiers shall be distinct Misra2012:5.5 LANG.ID.ND.MO Identifiers: closely mapped from macro names Macro/Other A typedef name shall be a Non-unique Misra2012:5.6 LANG.ID.NU.TYPE closely mapped unique identifier Identifiers: Typedef A tag name shall be a unique Non-unique Misra2012:5.7 LANG.ID.NU.TAG closely mapped identifier Identifiers: Tag Identifiers that define objects Non-unique Misra2012:5.8 or functions with external LANG.ID.NU.EXT Identifiers: External closely mapped linkage shall be unique Name

Identifiers that define objects Non-unique Misra2012:5.9 or functions with internal LANG.ID.NU.INT Identifiers: Internal closely mapped linkage should be unique Name Bit-fields shall only be Bit-field Signedness Misra2012:6.1 declared with an appropriate LANG.TYPE.BFSIGN closely mapped Not Explicit type Bit-fields shall only be Inappropriate Bit- Misra2012:6.1 declared with an appropriate LANG.TYPE.BFINT closely mapped field Type type Single-bit named bit fields Misra2012:6.2 LANG.TYPE.BFSHORT Bit-field Too Short closely mapped shall not be of a signed type Octal constants shall not be Misra2012:7.1 LANG.TYPE.OC Octal Constant closely mapped used A "u" or "U" suffix shall be applied to all integer Misra2012:7.2 constants that are LANG.TYPE.MSUF Missing Literal Suffix closely mapped represented in an unsigned type The lowercase character "l" Confusing Literal Misra2012:7.3 shall not be used in a literal LANG.TYPE.CSUF closely mapped Suffix suffix A string literal shall not be assigned to an object unless Non-const String Misra2012:7.4 LANG.TYPE.NCS closely mapped the object's type is "pointer to Literal const-qualified char" Function types shall be in Incomplete Function Misra2012:8.2 prototype form with named LANG.FUNCS.PROT closely mapped Prototype parameters All declarations of an object or Global Variable Misra2012:8.3 function shall use the same LANG.STRUCT.DECL.MGT Declared with closely mapped names and type qualifiers Different Types

All declarations of an object or Inconsistent Misra2012:8.3 function shall use the same LANG.STRUCT.DECL.IF Function closely mapped names and type qualifiers Declarations

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

All declarations of an object or Inconsistent Object Misra2012:8.3 function shall use the same LANG.STRUCT.DECL.IO closely mapped Declarations names and type qualifiers

An external object or function Missing External Misra2012:8.5 shall be declared once in one LANG.STRUCT.DECL.NOEXT closely mapped Declaration and only one file

An external object or function Multiple Declarations Misra2012:8.5 shall be declared once in one LANG.STRUCT.DECL.MG closely mapped of a Global and only one file

An external object or function LANG.STRUCT.DECL.MULTIE Multiple External Misra2012:8.5 shall be declared once in one closely mapped XT Declarations and only one file An identifier with external Missing External Misra2012:8.6 linkage shall have exactly one LANG.STRUCT.DEF.NOEXT closely mapped Definition external definition An identifier with external LANG.STRUCT.DEF.MULTIEX Multiple External Misra2012:8.6 linkage shall have exactly one closely mapped T Definitions external definition Functions and objects should not be defined with external Scope Could Be File Misra2012:8.7 LANG.STRUCT.SCOPE.FILE closely mapped linkage if they are referenced Static in only one translation unit

Functions and objects should not be defined with external LANG.STRUCT.SCOPE.LOCA Scope Could Be Misra2012:8.7 closely mapped linkage if they are referenced L Local Static in only one translation unit The static storage class specifier shall be used in all Scope Could Be File Misra2012:8.8 declarations of objects and LANG.STRUCT.SCOPE.FILE closely mapped Static functions that have internal linkage The static storage class specifier shall be used in all LANG.STRUCT.SCOPE.LOCA Scope Could Be Misra2012:8.8 declarations of objects and closely mapped L Local Static functions that have internal linkage An object should be defined at block scope if its identifier LANG.STRUCT.SCOPE.LOCA Scope Could Be Misra2012:8.9 closely mapped only appears in a single L Local Static function An inline function shall be Inline Function Not Misra2012:8.10 declared with the static LANG.TYPE.INS closely mapped static storage class When an array with external Extern Array Without Misra2012:8.11 linkage is declared, its size LANG.STRUCT.DECL.EAWS closely mapped Size should be explicitly specified Within an enumerator list, the Inconsistent value of an implicitly-specified Misra2012:8.12 LANG.STRUCT.INIT.ENUM Enumerator closely mapped enumeration constant shall be Initialization unique

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

The restrict type qualifier shall Restrict Qualifier Misra2012:8.14 LANG.TYPE.RESTRICT closely mapped not be used Used The value of an object with automatic storage duration Misra2012:9.1 LANG.MEM.UVAR Uninitialized Variable closely mapped shall not be read before it has been set The initializer for an aggregate Missing Braces in Misra2012:9.2 or union shall be enclosed in LANG.STRUCT.INIT.MBI closely mapped Initialization braces Arrays shall not be partially Partially Uninitialized Misra2012:9.3 LANG.STRUCT.INIT.PIARR closely mapped initialized Array An element of an object shall Over-initialized Misra2012:9.4 not be initialized more than LANG.STRUCT.INIT.OIE closely mapped Element once Operands shall not be of an Inappropriate Misra2012:10.1 LANG.TYPE.IOT closely mapped inappropriate essential type Operand Type Expressions of essentially character type shall not be Inappropriate Misra2012:10.2 used inappropriately in LANG.TYPE.ICA closely mapped Character Arithmetic addition and subtraction operations The value of an expression shall not be assigned to an Inappropriate Misra2012:10.3 object with a narrower LANG.TYPE.IAT closely mapped Assignment Type essential type or of a different essential type category

Both operands of an operator in which the usual arithmetic Mismatched Misra2012:10.4 conversions are performed LANG.TYPE.MOT closely mapped Operand Types shall have the same essential type category

The value of an expression Inappropriate Cast Misra2012:10.5 should not be cast to an LANG.TYPE.ICT closely mapped Type inappropriate essential type The value of a composite Expression Value expression shall not be Misra2012:10.6 LANG.TYPE.AWID Widened by closely mapped assigned to an object with Assignment wider essential type If a composite expression is used as one operand of an operator in which the usual Expression Value Misra2012:10.7 arithmetic conversions are LANG.TYPE.OWID Widened by Other closely mapped performed then the other Operand operand shall not have wider essential type The value of a composite expression shall not be cast to Inappropriate Cast Misra2012:10.8 a different essential type LANG.TYPE.ICTE closely mapped Type: Expression category or a wider essential type

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

Conversions shall not be performed between a pointer Conversion from Misra2012:11.1 LANG.CAST.PC.FN2DATA closely mapped to a function and any other Function Pointer type Conversions shall not be performed between a pointer Conversion to Misra2012:11.1 LANG.CAST.PC.DATA2FN closely mapped to a function and any other Function Pointer type Conversions shall not be performed between a pointer Dangerous Function Misra2012:11.1 LANG.CAST.FN closely mapped to a function and any other Cast type Conversions shall not be performed between a pointer LANG.STRUCT.FUNCPTR.CO Function Pointer Misra2012:11.1 closely mapped to a function and any other NVERT Conversion type Conversions shall not be performed between a pointer Conversion: Pointer Misra2012:11.2 LANG.CAST.PC.INC closely mapped to an incomplete type and any to Incomplete other type A cast shall not be performed between a pointer to object Cast: Object Misra2012:11.3 LANG.CAST.PC.OBJ closely mapped type and a pointer to a Pointers different object type

A conversion should not be Conversion: Misra2012:11.4 performed between a pointer LANG.CAST.PC.INT closely mapped Pointer/Integer to object and an integer type

A conversion should not be Conversion: Void Misra2012:11.5 performed from pointer to void LANG.CAST.PC.PV Pointer to Object closely mapped into pointer to object Pointer

A cast shall not be performed Cast: Arithmetic Misra2012:11.6 between pointer to void and LANG.CAST.PC.AV closely mapped Type/Void Pointer an arithmetic type

A cast shall not be performed Cast: Non-integer Misra2012:11.7 between pointer to object and LANG.CAST.PC.AO Arithmetic closely mapped a non-integer arithmetic type Type/Object Pointer A cast shall not remove any const or volatile qualification Cast Removes const Misra2012:11.8 LANG.CAST.PC.CRCQ closely mapped from the type pointed to by a Qualifier pointer A cast shall not remove any const or volatile qualification Cast Removes Misra2012:11.8 LANG.CAST.PC.CRVQ closely mapped from the type pointed to by a volatile Qualifier pointer The right hand operand of a shift operator shall lie in the range zero to one less than Negative Shift Misra2012:12.2 LANG.ARITH.NEGSHIFT closely mapped the width in bits of the Amount essential type of the left hand operand

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

The right hand operand of a shift operator shall lie in the range zero to one less than Shift Amount Misra2012:12.2 LANG.ARITH.BIGSHIFT closely mapped the width in bits of the Exceeds Bit Width essential type of the left hand operand The comma operator should Use of Comma Misra2012:12.3 LANG.STRUCT.COMMA closely mapped not be used Operator Evaluation of constant expressions should not lead Coercion Alters Misra2012:12.4 LANG.CAST.COERCE closely mapped to unsigned integer wrap- Value around A full expression containing an increment (++) or decrement (--) operator Side Effects in Misra2012:13.3 should have no other potential LANG.STRUCT.SE.DEC Expression with closely mapped side effects other than that Decrement caused by the increment or decrement operator

A full expression containing an increment (++) or decrement (--) operator Side Effects in Misra2012:13.3 should have no other potential LANG.STRUCT.SE.INC Expression with closely mapped side effects other than that Increment caused by the increment or decrement operator The operand of the sizeof operator shall not contain any Misra2012:13.6 LANG.STRUCT.SE.SIZEOF Side Effects in sizeof closely mapped expression which has potential side effects A loop counter shall not have Float-typed Loop Misra2012:14.1 LANG.STRUCT.LOOP.FPC closely mapped essentially floating type Counter LANG.STRUCT.LOOP.MFTER Malformed for-loop Misra2012:14.2 A for loop shall be well-formed closely mapped M Condition Malformed for-loop Misra2012:14.2 A for loop shall be well-formed LANG.STRUCT.LOOP.MFINIT closely mapped Initialization Malformed for-loop Misra2012:14.2 A for loop shall be well-formed LANG.STRUCT.LOOP.MFSTEP closely mapped Step LANG.STRUCT.LOOP.NOSTE Missing for-loop Misra2012:14.2 A for loop shall be well-formed closely mapped P Step LANG.STRUCT.LOOP.NOTER Missing for-loop Misra2012:14.2 A for loop shall be well-formed closely mapped M Termination Controlling expressions shall Redundant Misra2012:14.3 LANG.STRUCT.RC closely mapped not be invariant Condition The controlling expression of an if statement and the Condition Is Not Misra2012:14.4 controlling expression of an LANG.STRUCT.NBC closely mapped Boolean iteration-statement shall have essentially Boolean type The statement should not Misra2012:15.1 LANG.STRUCT.GOTO Goto Statement closely mapped be used The goto statement shall jump Misra2012:15.2 to a label declared later in the LANG.STRUCT.BGOTO Backwards goto closely mapped same function

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

Any label referenced by a goto statement shall be Label Not In Misra2012:15.3 declared in the same block, or LANG.STRUCT.GLABEL closely mapped Enclosing Block in any block enclosing the goto statement

There should be no more than one break or goto statement Multiple Abnormal Misra2012:15.4 LANG.STRUCT.LOOP.MAE closely mapped used to terminate any iteration Loop Exits statement

A function should have a Misplaced Return Misra2012:15.5 LANG.STRUCT.MISRS closely mapped single point of exit at the end Statement

A function should have a Multiple Return Misra2012:15.5 LANG.STRUCT.MULRS closely mapped single point of exit at the end Statements The body of an iteration- Body Is Not statement or a selection- Misra2012:15.6 LANG.STRUCT.BNC Compound closely mapped statement shall be a Statement compound-statement All if ... else if constructs shall Misra2012:15.7 be terminated with an else LANG.STRUCT.NOELSE Missing Final else closely mapped statement All switch statements shall be Malformed switch Misra2012:16.1 LANG.STRUCT.SW.BAD closely mapped well-formed Statement An unconditional break Misra2012:16.3 statement shall terminate LANG.STRUCT.SW.MB Missing break closely mapped every switch-clause Every switch statement shall Misra2012:16.4 LANG.STRUCT.SW.MD Missing default closely mapped have a default label A default label shall appear as either the first or the last Misra2012:16.5 LANG.STRUCT.SW.MPD Misplaced default closely mapped switch label of a switch statement Every switch statement shall Too Few Cases in Misra2012:16.6 have at least two switch- LANG.STRUCT.SW.IF closely mapped switch clauses A switch-expression shall not Boolean switch Misra2012:16.7 LANG.STRUCT.SW.BOOL closely mapped have essentially Boolean type Expression Functions shall not call Misra2012:17.2 themselves, either directly or LANG.FUNCS.RECURSION Recursion closely mapped indirectly A function shall not be Implicit Function Misra2012:17.3 LANG.STRUCT.DECL.IMPFN closely mapped declared implicitly Declaration All exit paths from a function with non-void return type shall Missing Return Misra2012:17.4 LANG.STRUCT.MRS closely mapped have an explicit return Statement statement with an expression The declaration of an array parameter shall not contain Static Array Misra2012:17.6 LANG.FUNCS.SAP closely mapped the static keyword between Parameter the [ ] The value returned by a Ignored Return Misra2012:17.7 function having non-void LANG.FUNCS.IRV closely mapped Value return type shall be used

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

A function parameter should Misra2012:17.8 LANG.FUNCS.MODP Modified Parameter closely mapped not be modified A pointer resulting from arithmetic on a pointer Misra2012:18.1 operand shall address an LANG.MEM.BO Buffer Overrun closely mapped element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Misra2012:18.1 operand shall address an LANG.MEM.BU Buffer Underrun closely mapped element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Pointer Before Misra2012:18.1 operand shall address an LANG.STRUCT.PBB closely mapped Beginning of Object element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Pointer Past End of Misra2012:18.1 operand shall address an LANG.STRUCT.PPE closely mapped Object element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Tainted Buffer Misra2012:18.1 operand shall address an LANG.MEM.TBA closely mapped Access element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Misra2012:18.1 operand shall address an LANG.MEM.TO Type Overrun closely mapped element of the same array as that pointer operand A pointer resulting from arithmetic on a pointer Misra2012:18.1 operand shall address an LANG.MEM.TU Type Underrun closely mapped element of the same array as that pointer operand Subtraction between pointers shall only be applied to Misra2012:18.2 LANG.MEM.BO Buffer Overrun closely mapped pointers that address elements of the same array

Subtraction between pointers shall only be applied to Misra2012:18.2 LANG.MEM.BU Buffer Underrun closely mapped pointers that address elements of the same array

Subtraction between pointers shall only be applied to Pointer Before Misra2012:18.2 LANG.STRUCT.PBB closely mapped pointers that address Beginning of Object elements of the same array

Subtraction between pointers shall only be applied to Pointer Past End of Misra2012:18.2 LANG.STRUCT.PPE closely mapped pointers that address Object elements of the same array

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

Subtraction between pointers shall only be applied to Tainted Buffer Misra2012:18.2 LANG.MEM.TBA closely mapped pointers that address Access elements of the same array

Subtraction between pointers shall only be applied to Misra2012:18.2 LANG.MEM.TO Type Overrun closely mapped pointers that address elements of the same array

Subtraction between pointers shall only be applied to Misra2012:18.2 LANG.MEM.TU Type Underrun closely mapped pointers that address elements of the same array Declarations should contain Too Much Misra2012:18.5 no more than two levels of LANG.STRUCT.TMID Indirection in closely mapped pointer nesting Declaration Declaration of Flexible array members shall Misra2012:18.7 LANG.STRUCT.DECL.FAM Flexible Array closely mapped not be declared Member Declaration of Variable-length array types Misra2012:18.8 LANG.STRUCT.DECL.VLA Variable Length closely mapped shall not be used Array An object shall not be Overlapping Memory Misra2012:19.1 assigned or copied to an MISC.MEM.OR closely mapped Regions overlapping object The union keyword should not Misra2012:19.2 LANG.TYPE.UNION Union Type closely mapped be used #include directives should only be preceded by Code Before Misra2012:20.1 LANG.PREPROC.CBI closely mapped preprocessor directives or #include comments The ', " or \ characters and the /* or // character sequences Dangerous Include Misra2012:20.2 LANG.PREPROC.INCL.FNAME closely mapped shall not occur in a header file File Name name The # shall be followed by either a Misra2012:20.3 LANG.PREPROC.INCL.MF Malformed #include closely mapped or "filename" sequence A macro shall not be defined Macro Name is C Misra2012:20.4 with the same name as a LANG.ID.NU.MK closely mapped Keyword keyword Macro Undefinition Misra2012:20.5 #undef should not be used LANG.PREPROC.RUNDEF closely mapped of Reserved Name

Misra2012:20.5 #undef should not be used LANG.PREPROC.UNDEF Use of #undef closely mapped Tokens that look like a Preprocessing preprocessing directive shall Misra2012:20.6 LANG.PREPROC.MACROARG Directives in Macro closely mapped not occur within a macro Argument argument Expressions resulting from the expansion of macro Macro Parameter Misra2012:20.7 LANG.PREPROC.NOFPAREN closely mapped parameters shall be enclosed Not Parenthesized in parentheses

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

The # and ## preprocessor Macro Uses ## Misra2012:20.10 LANG.PREPROC.PASTE closely mapped operators should not be used Operator A line whose first token is # Invalid Preprocessor Misra2012:20.13 shall be a valid preprocessing LANG.PREPROC.INVALID closely mapped Directive directive All #else, #elif and #endif preprocessor directives shall Misra2012:20.14 reside in the same file as the LANG.PREPROC.NOENDIF No Matching #endif closely mapped #if, #ifdef or #ifndef directive to which they are related

All #else, #elif and #endif preprocessor directives shall Misra2012:20.14 reside in the same file as the LANG.PREPROC.NOIF No Matching #if closely mapped #if, #ifdef or #ifndef directive to which they are related #define and #undef shall not be used on a reserved Macro Definition of Misra2012:21.1 LANG.PREPROC.RDEF closely mapped identifier or reserved macro Reserved Name name #define and #undef shall not be used on a reserved Macro Undefinition Misra2012:21.1 LANG.PREPROC.RUNDEF closely mapped identifier or reserved macro of Reserved Name name The memory allocation and Dynamic Allocation Misra2012:21.3 deallocation functions of ALLOC.POSTINIT closely mapped After Initialization shall not be used

The standard header file LANG.PREPROC.INCL.SETJM Misra2012:21.4 Use of closely mapped shall not be used P_H

The standard header file Misra2012:21.4 BADFUNC.LONGJMP Use of longjmp closely mapped shall not be used

The standard header file Misra2012:21.4 BADFUNC.SETJMP Use of setjmp closely mapped shall not be used

The standard header file LANG.PREPROC.INCL.SIGNA Misra2012:21.5 Use of closely mapped shall not be used L_H The Standard Library Use of Misra2012:21.6 input/output functions shall BADFUNC.STDIO_H closely mapped Input/Output not be used The Standard Library Use of Misra2012:21.6 input/output functions shall BADFUNC.WCHAR_H closely mapped Input/Output not be used The atof, atoi, atol and atoll Misra2012:21.7 functions of shall BADFUNC.ATOF Use of atof closely mapped not be used The atof, atoi, atol and atoll Misra2012:21.7 functions of shall BADFUNC.ATOI Use of atoi closely mapped not be used The atof, atoi, atol and atoll Misra2012:21.7 functions of shall BADFUNC.ATOL Use of atol closely mapped not be used

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

The atof, atoi, atol and atoll Misra2012:21.7 functions of shall BADFUNC.ATOLL Use of atoll closely mapped not be used The library functions abort, Misra2012:21.8 exit, getenv and system of BADFUNC.ABORT Use of abort closely mapped shall not be used

The library functions abort, Misra2012:21.8 exit, getenv and system of BADFUNC.EXIT Use of exit closely mapped shall not be used

The library functions abort, Misra2012:21.8 exit, getenv and system of BADFUNC.GETENV Use of getenv closely mapped shall not be used

The library functions abort, Misra2012:21.8 exit, getenv and system of BADFUNC.PATH.SYSTEM Use of system closely mapped shall not be used

The library functions bsearch Misra2012:21.9 and qsort of shall BADFUNC.BSEARCH Use of bsearch closely mapped not be used

The library functions bsearch Misra2012:21.9 and qsort of shall BADFUNC.QSORT Use of qsort closely mapped not be used The Standard Library time and Use of Misra2012:21.10 date functions shall not be BADFUNC.TIME_H closely mapped Time/Date Function used The standard header file LANG.PREPROC.INCL.TGMAT Misra2012:21.11 Use of closely mapped shall not be used H_H The exception handling Use of Misra2012:21.12 features of should BADFUNC.FENV_H Exception Handling closely mapped not be used Function All resources obtained dynamically by means of Misra2012:22.1 ALLOC.LEAK Leak closely mapped Standard Library functions shall be explicitly released A block of memory shall only be freed if it was allocated by Free Non-Heap Misra2012:22.2 ALLOC.FNH closely mapped means of a Standard Library Variable function There shall be no attempt to Write to Read Only Misra2012:22.4 write to a stream which has IO.WRITERO closely mapped File been opened as read-only A pointer to a FILE object shall Misra2012:22.5 IO.FILEDEREF FILE* Dereference closely mapped not be dereferenced The value of a pointer to a FILE shall not be used after Misra2012:22.6 IO.UAC Use After Close closely mapped the associated stream has been closed shall be Mixed Assembly and Misra2012:.4.3 LANG.ASM.MIXED closely mapped encapsulated and isolated Code

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc. MISRA C 2012 Mapping to CodeSonar®

Sections of code should not Commented-out Misra2012:D.4.4 LANG.COMM.CODE closely mapped be "commented out" Code Identifiers in the same name Typographically space with overlapping Misra2012:D.4.5 LANG.ID.AMBIG Ambiguous closely mapped visibility should be Identifiers typographically unambiguous typedefs that indicate size and signedness should be Basic Numerical Misra2012:D.4.6 LANG.TYPE.BASIC closely mapped used in place of the basic Type Used numerical types If a function returns error Ignored Return Misra2012:D.4.7 information, then that error LANG.FUNCS.IRV closely mapped Value information shall be tested Dynamic memory allocation Dynamic Allocation Misra2012:D.4.12 ALLOC.POSTINIT closely mapped shall not be used After Initialization

GrammaTech Confidential and Proprietary. CodeSonar is a registered trademark of GrammaTech, Inc.