# This file was generated from template 'codesonar/presets/misra2004_inc.conf.in' # # This conf file configures CodeSonar to generate warnings for various # MISRA C:2004 rules. Specifically, it enables CodeSonar warning classes that # - correspond to MISRA C:2004 rules, AND # - have checks that are compatible with incremental build/analysis. # Configuration settings required by one or more MISRA checks. SCOPE_CHECK_SUGGESTS_LOCAL_STATIC = Yes BOOL_TYPES += bool,true,false # Explicitly enable all warning classes that correspond to one or more # MISRA C:2004 rules, for C compilation units. # # (If any of these classes is already enabled for C++ compilation # units, it will remain enabled.) # # - Some of the the MISRA-related classes are enabled by default, but # others are not. Classes that are enabled by default are indicated with a # comment directly above the WARNING_FILTER setting. # - If you also want to enable a class for C++ compilation units, # delete "language=c" from the corresponding WARNING_FILTER setting. # # This part of this file was generated from 'cso_wcmanifest.py' # # At least one of the classes enabled by this preset requires unnormalized C ASTs RETAIN_UNNORMALIZED_C_AST = Yes # Misra2004:2.3: The character sequence /* shall not be used within a comment WARNING_FILTER += allow class="/* in // Comment" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked WARNING_FILTER += allow class="Addition Overflow of Allocation Size" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Arctangent Domain Error" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Argument Too High" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Argument Too Low" language=c # Misra2004:13.1: Assignment operators shall not be used in expressions that yield a Boolean value WARNING_FILTER += allow class="Assignment Result in Expression" language=c # Misra2004:14.4: The goto statement shall not be used WARNING_FILTER += allow class="Backwards goto" language=c # Misra2004:4.1: Only those escape sequences that are defined in the ISO C standard shall be used # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Bad Character Value" language=c # Misra2004:6.3: typedefs that indicate size and signedness should be used in place of the basic numerical types WARNING_FILTER += allow class="Basic Numerical Type Used" language=c # Misra2004:6.4: Bit fields shall only be defined to be of type unsigned int or signed int WARNING_FILTER += allow class="Bit-field Signedness Not Explicit" language=c # Misra2004:18.4: Unions shall not be used # Misra2004:3.5: The implementation defined behaviour and packing of bitfields shall be documented if being relied upon WARNING_FILTER += allow class="Bit-field in Union" language=c # Misra2004:14.3: Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment provided that the first character following the null statement is a white-space character # Misra2004:14.8: The statement forming the body of a switch, while, do ... while or for statement shall be a compound statement # Misra2004:14.9: An if (expression) construct shall be followed by a compound statement. The else keyword shall be followed by either a compound statement, or another if statement WARNING_FILTER += allow class="Body Is Not Compound Statement" language=c # Misra2004:15.4: A switch expression shall not represent a value that is effectively Boolean WARNING_FILTER += allow class="Boolean switch Expression" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Buffer Overrun" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Buffer Underrun" language=c # Misra2004:1.1: All code shall conform to ISO/IEC 9899:1990 "Programming languages C", amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2:1996 # Misra2004:2.2: Source code shall only use /* ... */ style comments WARNING_FILTER += allow class="C++ Comment in C" language=c # Misra2004:11.5: A cast shall not be performed that removes any const or volatile qualification from the type addressed by a pointer WARNING_FILTER += allow class="Cast Removes const Qualifier" language=c # Misra2004:11.5: A cast shall not be performed that removes any const or volatile qualification from the type addressed by a pointer WARNING_FILTER += allow class="Cast Removes volatile Qualifier" language=c # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type WARNING_FILTER += allow class="Cast: Arithmetic Type/Void Pointer" language=c # Misra2004:11.2: Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void WARNING_FILTER += allow class="Cast: Non-integer Arithmetic Type/Object Pointer" language=c # Misra2004:11.4: A cast should not be performed between a pointer to object type and a different pointer to object type WARNING_FILTER += allow class="Cast: Object Pointers" language=c # Misra2004:11.4: A cast should not be performed between a pointer to object type and a different pointer to object type WARNING_FILTER += allow class="Cast: Virtual Base to Derived" language=c # Misra2004:19.1: #include statements in a file should only be preceded by other preprocessor directives or comments WARNING_FILTER += allow class="Code Before #include" language=c # Misra2004:12.11: Evaluation of constant unsigned integer expressions should not lead to wraparound # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Coercion Alters Value" language=c # Misra2004:2.4: Sections of code should not be "commented out" WARNING_FILTER += allow class="Commented-out Code" language=c # Misra2004:17.3: >, >=, <, <= shall not be applied to pointer types except where they point to the same array # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Comparison of Unrelated Pointers" language=c # Misra2004:13.2: Tests of a value against zero should be made explicit, unless the operand is effectively Boolean WARNING_FILTER += allow class="Condition Is Not Boolean" language=c # Misra2004:14.5: The continue statement shall not be used WARNING_FILTER += allow class="Continue Statement" language=c # Misra2004:11.2: Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type WARNING_FILTER += allow class="Conversion: Pointer to Incomplete" language=c # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type WARNING_FILTER += allow class="Conversion: Pointer/Integer" language=c # Misra2004:11.2: Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void WARNING_FILTER += allow class="Conversion: Void Pointer to Object Pointer" language=c # Misra2004:11.1: Conversions shall not be performed between a pointer to a function and any type other than an integral type # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Dangerous Function Cast" language=c # Misra2004:19.2: Non-standard characters should not occur in header file names in #include directives WARNING_FILTER += allow class="Dangerous Include File Name" language=c # Misra2004:20.2: The names of standard library macros, objects and functions shall not be reused WARNING_FILTER += allow class="Declaration of Reserved Name" language=c # Misra2004:11.4: A cast should not be performed between a pointer to object type and a different pointer to object type WARNING_FILTER += allow class="Derived Class From Virtual Base" language=c # Misra2004:20.4: Dynamic heap memory allocation shall not be used WARNING_FILTER += allow class="Dynamic Allocation After Initialization" language=c # Misra2004:16.1: Functions shall not be defined with variable numbers of arguments WARNING_FILTER += allow class="Ellipsis" language=c # Misra2004:10.1: The value of an expression of integer type shall not be implicitly converted to a different underlying type if: (a) it is not a conversion to a wider integer type of the same signedness, or (b) the expression is complex, or (c) the expression is not constant and is a function argument, or (d) the expression is not constant and is a return expression # Misra2004:10.2: The value of an expression of floating type shall not be implicitly converted to a different type if: (a) it is not a conversion to a wider floating type, or (b) the expression is complex, or (c) the expression is a function argument, or (d) the expression is a return expression WARNING_FILTER += allow class="Expression Value Widened by Assignment" language=c # Misra2004:10.1: The value of an expression of integer type shall not be implicitly converted to a different underlying type if: (a) it is not a conversion to a wider integer type of the same signedness, or (b) the expression is complex, or (c) the expression is not constant and is a function argument, or (d) the expression is not constant and is a return expression # Misra2004:10.2: The value of an expression of floating type shall not be implicitly converted to a different type if: (a) it is not a conversion to a wider floating type, or (b) the expression is complex, or (c) the expression is a function argument, or (d) the expression is a return expression WARNING_FILTER += allow class="Expression Value Widened by Other Operand" language=c # Misra2004:8.12: When an array is declared with external linkage, its size shall be stated explicitly or defined implicitly by initialisation WARNING_FILTER += allow class="Extern Array Without Size" language=c # Misra2004:12.12: The underlying bit representations of floating-point values shall not be used WARNING_FILTER += allow class="Float Pointer Conversion" language=c # Misra2004:13.4: The controlling expression of a for statement shall not contain any objects of floating type WARNING_FILTER += allow class="Float-typed Loop Counter" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Floating Point Domain Error" language=c # Misra2004:13.3: Floating-point expressions shall not be tested for equality or inequality WARNING_FILTER += allow class="Floating Point Equality" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Floating Point Range Error" language=c # Misra2004:14.2: All non-null statements shall either (a) have at least one side-effect however executed, or (b) cause control flow to change # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Function Call Has No Effect" language=c # Misra2004:8.5: There shall be no definitions of objects or functions in a header file WARNING_FILTER += allow class="Function Defined in Header File" language=c # Misra2004:11.1: Conversions shall not be performed between a pointer to a function and any type other than an integral type # Misra2004:11.2: Conversions shall not be performed between a pointer to object and any type other than an integral type, another pointer to object type or a pointer to void # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type WARNING_FILTER += allow class="Function Pointer Conversion" language=c # Misra2004:19.7: A function should be used in preference to a function-like macro WARNING_FILTER += allow class="Function-Like Macro" language=c # Misra2004:1.1: All code shall conform to ISO/IEC 9899:1990 "Programming languages C", amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2:1996 # Misra2004:2.2: Source code shall only use /* ... */ style comments WARNING_FILTER += allow class="GNU Extension" language=c # Misra2004:1.1: All code shall conform to ISO/IEC 9899:1990 "Programming languages C", amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2:1996 # Misra2004:2.2: Source code shall only use /* ... */ style comments WARNING_FILTER += allow class="GNU Typeof" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Gamma on Zero" language=c # Misra2004:16.4: The identifiers used in the declaration and definition of a function shall be identical # Misra2004:8.3: For each function parameter the type given in the declaration and definition shall be identical, and the return types shall also be identical # Misra2004:8.4: If objects or functions are declared more than once their types shall be compatible WARNING_FILTER += allow class="Global Variable Declared with Different Types" language=c # Misra2004:14.4: The goto statement shall not be used WARNING_FILTER += allow class="Goto Statement" language=c # Misra2004:16.10: If a function returns error information, then that error information shall be tested # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Ignored Return Value" language=c # Misra2004:16.9: A function identifier shall only be used with either a preceding &, or with a parenthesised parameter list, which may be empty WARNING_FILTER += allow class="Implicit Address of Function" language=c # Misra2004:8.1: Functions shall have prototype declarations and the prototype shall be visible at both the function definition and call # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Implicit Function Declaration" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Implicit int on main" language=c # Misra2004:10.1: The value of an expression of integer type shall not be implicitly converted to a different underlying type if: (a) it is not a conversion to a wider integer type of the same signedness, or (b) the expression is complex, or (c) the expression is not constant and is a function argument, or (d) the expression is not constant and is a return expression # Misra2004:10.2: The value of an expression of floating type shall not be implicitly converted to a different type if: (a) it is not a conversion to a wider floating type, or (b) the expression is complex, or (c) the expression is a function argument, or (d) the expression is a return expression # Misra2004:6.1: The plain char type shall be used only for storage and use of character values # Misra2004:6.2: signed and unsigned char type shall be used only for the storage and use of numeric values WARNING_FILTER += allow class="Inappropriate Assignment Type" language=c # Misra2004:6.4: Bit fields shall only be defined to be of type unsigned int or signed int WARNING_FILTER += allow class="Inappropriate Bit-field Type" language=c # Misra2004:10.3: The value of a complex expression of integer type shall only be cast to a type of the same signedness that is no wider than the underlying type of the expression # Misra2004:10.4: The value of a complex expression of floating type shall only be cast to a floating type that is narrower or of the same size WARNING_FILTER += allow class="Inappropriate Cast Type: Expression" language=c # Misra2004:6.1: The plain char type shall be used only for storage and use of character values WARNING_FILTER += allow class="Inappropriate Character Arithmetic" language=c # "Inappropriate Include File Specification" is not enabled by this preset. # - All of its relevant categories are more closely related to other classes that are enabled by the preset. # - Misra2004:19.3 is better matched by "Malformed #include" # Misra2004:10.1: The value of an expression of integer type shall not be implicitly converted to a different underlying type if: (a) it is not a conversion to a wider integer type of the same signedness, or (b) the expression is complex, or (c) the expression is not constant and is a function argument, or (d) the expression is not constant and is a return expression # Misra2004:10.2: The value of an expression of floating type shall not be implicitly converted to a different type if: (a) it is not a conversion to a wider floating type, or (b) the expression is complex, or (c) the expression is a function argument, or (d) the expression is a return expression # Misra2004:6.1: The plain char type shall be used only for storage and use of character values # Misra2004:6.2: signed and unsigned char type shall be used only for the storage and use of numeric values WARNING_FILTER += allow class="Inappropriate Numeric Assignment" language=c # Misra2004:12.6: The operands of logical operators (&&, || and !) should be effectively Boolean. Expressions that are effectively Boolean should not be used as operands to operators other than (&&, || , !, =, ==, != and ?:) # Misra2004:12.7: Bitwise operators shall not be applied to operands whose underlying type is signed # Misra2004:12.9: The unary minus operator shall not be applied to an expression whose underlying type is unsigned # Misra2004:6.1: The plain char type shall be used only for storage and use of character values # Misra2004:6.2: signed and unsigned char type shall be used only for the storage and use of numeric values WARNING_FILTER += allow class="Inappropriate Operand Type" language=c # Misra2004:20.5: The error indicator errno shall not be used WARNING_FILTER += allow class="Inappropriate Test of Error Code" language=c # Misra2004:19.15: Precautions shall be taken in order to prevent the contents of a header file being included twice WARNING_FILTER += allow class="Include File Without Guard" language=c # Misra2004:16.3: Identifiers shall be given for all of the parameters in a function prototype declaration # Misra2004:16.5: Functions with no parameters shall be declared and defined with the parameter list void # Misra2004:16.6: The number of arguments passed to a function shall match the number of parameters # Misra2004:8.1: Functions shall have prototype declarations and the prototype shall be visible at both the function definition and call # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Incomplete Function Prototype" language=c # Misra2004:9.3: In an enumerator list, the "=" construct shall not be used to explicitly initialise members other than the first, unless all items are explicitly initialised WARNING_FILTER += allow class="Inconsistent Enumerator Initialization" language=c # Misra2004:16.4: The identifiers used in the declaration and definition of a function shall be identical # Misra2004:8.3: For each function parameter the type given in the declaration and definition shall be identical, and the return types shall also be identical # Misra2004:8.4: If objects or functions are declared more than once their types shall be compatible # "Inconsistent Function Declarations" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:16.4: The identifiers used in the declaration and definition of a function shall be identical # Misra2004:8.3: For each function parameter the type given in the declaration and definition shall be identical, and the return types shall also be identical # Misra2004:8.4: If objects or functions are declared more than once their types shall be compatible # "Inconsistent Object Declarations" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:12.2: The value of an expression shall be the same under any order of evaluation that the standard permits WARNING_FILTER += allow class="Indeterminate Order of Evaluation" language=c # Misra2004:2.1: Assembly language shall be encapsulated and isolated WARNING_FILTER += allow class="Inline Assembly Code" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Integer Overflow of Allocation Size" language=c # Misra2004:14.4: The goto statement shall not be used WARNING_FILTER += allow class="Label Not In Enclosing Block" language=c # Misra2004:5.7: No identifier name should be reused WARNING_FILTER += allow class="Library Function Override" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Logarithm on Negative Value" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Logarithm on Zero" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="MAX_PATH Exceeded" language=c # Misra2004:19.13: The # and ## preprocessor operators should not be used WARNING_FILTER += allow class="Macro Argument is both Mixed and Expanded" language=c # Misra2004:19.5: Macros shall not be #define'd or #undef'd within a block WARNING_FILTER += allow class="Macro Defined in Function Body" language=c # Misra2004:20.1: Reserved identifiers, macros and functions in the standard library, shall not be defined, redefined or undefined WARNING_FILTER += allow class="Macro Definition of Reserved Name" language=c # Misra2004:19.4: C macros shall only expand to a braced initialiser, a constant, a string literal, a parenthesised expression, a type qualifier, a storage class specifier, or a do-whilezero construct WARNING_FILTER += allow class="Macro Name is C Keyword" language=c # Misra2004:19.5: Macros shall not be #define'd or #undef'd within a block WARNING_FILTER += allow class="Macro Undefined in Function Body" language=c # Misra2004:19.6: #undef shall not be used # Misra2004:20.1: Reserved identifiers, macros and functions in the standard library, shall not be defined, redefined or undefined WARNING_FILTER += allow class="Macro Undefinition of Reserved Name" language=c # Misra2004:19.13: The # and ## preprocessor operators should not be used WARNING_FILTER += allow class="Macro Uses # Operator" language=c # Misra2004:19.13: The # and ## preprocessor operators should not be used WARNING_FILTER += allow class="Macro Uses ## Operator" language=c # Misra2004:19.3: The #include directive shall be followed by either a or "filename" sequence WARNING_FILTER += allow class="Malformed #include" language=c # Misra2004:13.5: The three expressions of a for statement shall be concerned only with loop control # Misra2004:13.6: Numeric variables being used within a for loop for iteration counting shall not be modified in the body of the loop WARNING_FILTER += allow class="Malformed for-loop Condition" language=c # Misra2004:13.5: The three expressions of a for statement shall be concerned only with loop control # Misra2004:13.6: Numeric variables being used within a for loop for iteration counting shall not be modified in the body of the loop WARNING_FILTER += allow class="Malformed for-loop Initialization" language=c # Misra2004:15.0: The MISRA C switch syntax shall be used WARNING_FILTER += allow class="Malformed switch Statement" language=c # Misra2004:1.1: All code shall conform to ISO/IEC 9899:1990 "Programming languages C", amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2:1996 # Misra2004:2.2: Source code shall only use /* ... */ style comments WARNING_FILTER += allow class="Microsoft Extension" language=c # Misra2004:10.1: The value of an expression of integer type shall not be implicitly converted to a different underlying type if: (a) it is not a conversion to a wider integer type of the same signedness, or (b) the expression is complex, or (c) the expression is not constant and is a function argument, or (d) the expression is not constant and is a return expression # Misra2004:10.2: The value of an expression of floating type shall not be implicitly converted to a different type if: (a) it is not a conversion to a wider floating type, or (b) the expression is complex, or (c) the expression is a function argument, or (d) the expression is a return expression # Misra2004:6.1: The plain char type shall be used only for storage and use of character values # Misra2004:6.2: signed and unsigned char type shall be used only for the storage and use of numeric values WARNING_FILTER += allow class="Mismatched Operand Types" language=c # Misra2004:14.7: A function shall have a single point of exit at the end of the function WARNING_FILTER += allow class="Misplaced Return Statement" language=c # Misra2004:15.1: A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement WARNING_FILTER += allow class="Misplaced case" language=c # Misra2004:15.3: The final clause of a switch statement shall be the default clause WARNING_FILTER += allow class="Misplaced default" language=c # Misra2004:9.2: Braces shall be used to indicate and match the structure in the non-zero initialisation of arrays and structures WARNING_FILTER += allow class="Missing Braces in Initialization" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Missing Declaration Specifiers" language=c # Misra2004:8.8: An external object or function shall be declared in one and only one file # "Missing External Declaration" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:8.9: An identifier with external linkage shall have exactly one external definition # "Missing External Definition" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:14.10: All if . else if constructs shall be terminated with an else clause WARNING_FILTER += allow class="Missing Final else" language=c # Misra2004:10.6: A "U" suffix shall be applied to all constants of unsigned type WARNING_FILTER += allow class="Missing Literal Suffix" language=c # Misra2004:12.1: Limited dependence should be placed on C's operator precedence rules in expressions WARNING_FILTER += allow class="Missing Parentheses" language=c # Misra2004:16.8: All exit paths from a function with non-void return type shall have an explicit return statement with an expression # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Missing Return Statement" language=c # Misra2004:16.8: All exit paths from a function with non-void return type shall have an explicit return statement with an expression # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Missing Return Value" language=c # Misra2004:16.10: If a function returns error information, then that error information shall be tested WARNING_FILTER += allow class="Missing Test of Error Code" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Missing Type Specifier" language=c # Misra2004:15.2: An unconditional break statement shall terminate every non-empty switch clause WARNING_FILTER += allow class="Missing break" language=c # Misra2004:15.3: The final clause of a switch statement shall be the default clause WARNING_FILTER += allow class="Missing default" language=c # Misra2004:13.5: The three expressions of a for statement shall be concerned only with loop control # Misra2004:13.6: Numeric variables being used within a for loop for iteration counting shall not be modified in the body of the loop WARNING_FILTER += allow class="Missing for-loop Step" language=c # Misra2004:13.5: The three expressions of a for statement shall be concerned only with loop control # Misra2004:13.6: Numeric variables being used within a for loop for iteration counting shall not be modified in the body of the loop WARNING_FILTER += allow class="Missing for-loop Termination" language=c # Misra2004:2.1: Assembly language shall be encapsulated and isolated WARNING_FILTER += allow class="Mixed Assembly and Code" language=c # Misra2004:14.6: For any iteration statement there shall be at most one break statement used for loop termination WARNING_FILTER += allow class="Multiple Abnormal Loop Exits" language=c # Misra2004:8.8: An external object or function shall be declared in one and only one file WARNING_FILTER += allow class="Multiple Declarations of a Global" language=c # Misra2004:8.8: An external object or function shall be declared in one and only one file # "Multiple External Declarations" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:8.9: An identifier with external linkage shall have exactly one external definition # "Multiple External Definitions" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:14.7: A function shall have a single point of exit at the end of the function WARNING_FILTER += allow class="Multiple Return Statements" language=c # Misra2004:12.8: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Negative Shift Amount" language=c # Misra2004:2.3: The character sequence /* shall not be used within a comment # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Nested Comment" language=c # Misra2004:8.6: Functions shall be declared at file scope WARNING_FILTER += allow class="Nested Function Declaration" language=c # Misra2004:19.17: All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related WARNING_FILTER += allow class="No Matching #endif" language=c # Misra2004:19.17: All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related WARNING_FILTER += allow class="No Matching #if" language=c # Misra2004:8.1: Functions shall have prototype declarations and the prototype shall be visible at both the function definition and call WARNING_FILTER += allow class="No Previous Declaration" language=c # Misra2004:5.1: Identifiers (internal and external) shall not rely on the significance of more than 31 characters # "Non-distinct Identifiers: External Names" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:5.1: Identifiers (internal and external) shall not rely on the significance of more than 31 characters WARNING_FILTER += allow class="Non-distinct Identifiers: Macro/Macro" language=c # Misra2004:5.1: Identifiers (internal and external) shall not rely on the significance of more than 31 characters # "Non-distinct Identifiers: Macro/Other" is not enabled by this preset. # - It is not compatible with INCREMENTAL_BUILD=Yes. # Misra2004:5.1: Identifiers (internal and external) shall not rely on the significance of more than 31 characters # Misra2004:5.2: Identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide that identifier WARNING_FILTER += allow class="Non-distinct Identifiers: Nested Scope" language=c # Misra2004:5.1: Identifiers (internal and external) shall not rely on the significance of more than 31 characters WARNING_FILTER += allow class="Non-distinct Identifiers: Same Scope" language=c # Misra2004:5.5: No object or function identifier with static storage duration should be reused WARNING_FILTER += allow class="Non-unique Identifiers: External Name" language=c # Misra2004:5.5: No object or function identifier with static storage duration should be reused WARNING_FILTER += allow class="Non-unique Identifiers: Internal Name" language=c # Misra2004:5.4: A tag name shall be a unique identifier WARNING_FILTER += allow class="Non-unique Identifiers: Tag" language=c # Misra2004:5.3: A typedef name shall be a unique identifier WARNING_FILTER += allow class="Non-unique Identifiers: Typedef" language=c # Misra2004:16.10: If a function returns error information, then that error information shall be tested # Misra2004:20.5: The error indicator errno shall not be used WARNING_FILTER += allow class="Non-zero Error Code" language=c # Misra2004:20.5: The error indicator errno shall not be used WARNING_FILTER += allow class="Non-zero Error Code Assignment" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Nonstandard Implicit Integer" language=c # Misra2004:8.5: There shall be no definitions of objects or functions in a header file WARNING_FILTER += allow class="Object Defined in Header File" language=c # Misra2004:7.1: Octal constants (other than zero) and octal escape sequences shall not be used WARNING_FILTER += allow class="Octal Constant" language=c # Misra2004:18.2: An object shall not be assigned to an overlapping object # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Overlapping Memory Regions" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Parameter Identifier List Needs Function Definition" language=c # Misra2004:9.2: Braces shall be used to indicate and match the structure in the non-zero initialisation of arrays and structures WARNING_FILTER += allow class="Partially Uninitialized Array" language=c # Misra2004:16.7: A pointer parameter in a function prototype should be declared as pointer to const if the pointer is not used to modify the addressed object WARNING_FILTER += allow class="Pointed-to Type Could Be const" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # Misra2004:17.4: Array indexing shall be the only allowed form of pointer arithmetic WARNING_FILTER += allow class="Pointer Arithmetic" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array WARNING_FILTER += allow class="Pointer Before Beginning of Object" language=c # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Pointer Conversion Loses Bits" language=c # Misra2004:11.3: A cast should not be performed between a pointer type and an integral type WARNING_FILTER += allow class="Pointer Conversion to Same Size Integer" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array WARNING_FILTER += allow class="Pointer Past End of Object" language=c # Misra2004:20.12: The time handling functions of library shall not be used WARNING_FILTER += allow class="Potential Timebomb" language=c # Misra2004:19.9: Arguments to a function-like macro shall not contain tokens that look like preprocessing directives WARNING_FILTER += allow class="Preprocessing Directives in Macro Argument" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Raises FE_INVALID" language=c # Misra2004:16.2: Functions shall not call themselves, either directly or indirectly WARNING_FILTER += allow class="Recursion" language=c # Misra2004:13.7: Boolean operations whose results are invariant shall not be permitted # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Redundant Condition" language=c # Misra2004:10.5: If the bitwise operators ~ and << are applied to an operand of underlying type unsigned char or unsigned short, the result shall be immediately cast to the underlying type of the operand WARNING_FILTER += allow class="Risky Integer Promotion" language=c # Misra2004:8.10: All declarations and definitions of objects or functions at file scope shall have internal linkage unless external linkage is required # Misra2004:8.11: The static storage class specifier shall be used in definitions and declarations of objects and functions that have internal linkage WARNING_FILTER += allow class="Scope Could Be File Static" language=c # Misra2004:8.10: All declarations and definitions of objects or functions at file scope shall have internal linkage unless external linkage is required # Misra2004:8.11: The static storage class specifier shall be used in definitions and declarations of objects and functions that have internal linkage # Misra2004:8.7: Objects shall be defined at block scope if they are only accessed from within a single function WARNING_FILTER += allow class="Scope Could Be Local Static" language=c # Misra2004:12.8: The right-hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Shift Amount Exceeds Bit Width" language=c # Misra2004:12.13: The increment (++) and decrement (--) operators should not be mixed with other operators in an expression WARNING_FILTER += allow class="Side Effects in Expression with Decrement" language=c # Misra2004:12.13: The increment (++) and decrement (--) operators should not be mixed with other operators in an expression WARNING_FILTER += allow class="Side Effects in Expression with Increment" language=c # Misra2004:12.4: The right-hand operand of a logical && or || operator shall not contain side effects WARNING_FILTER += allow class="Side Effects in Logical Operand" language=c # Misra2004:12.3: The sizeof operator shall not be used on expressions that contain side effects WARNING_FILTER += allow class="Side Effects in sizeof" language=c # Misra2004:6.5: Bit fields of signed type shall be at least 2 bits long # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Signed One Bit Field" language=c # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # Misra2004:17.4: Array indexing shall be the only allowed form of pointer arithmetic # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Subtraction of Unrelated Pointers" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Tainted Buffer Access" language=c # Misra2004:15.5: Every switch statement shall have at least one case clause WARNING_FILTER += allow class="Too Few Cases in switch" language=c # Misra2004:4.2: Trigraphs shall not be used WARNING_FILTER += allow class="Trigraph" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Type Overrun" language=c # Misra2004:17.1: Pointer arithmetic shall only be applied to pointers that address an array or array element # Misra2004:17.2: Pointer subtraction shall only be applied to pointers that address elements of the same array # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Type Underrun" language=c # Misra2004:8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Undeclared Parameter" language=c # Misra2004:19.11: All macro identifiers in preprocessor directives shall be defined before use, except in #ifdef and #ifndef preprocessor directives and the defined() operator # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Undefined Macro in #if" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Undefined Power of Zero" language=c # Misra2004:9.1: All automatic variables shall have been assigned a value before being used # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Uninitialized Variable" language=c # Misra2004:18.4: Unions shall not be used WARNING_FILTER += allow class="Union Type" language=c # Misra2004:4.1: Only those escape sequences that are defined in the ISO C standard shall be used # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Universal Character Name Names Invalid Code Point" language=c # Misra2004:14.1: There shall be no unreachable code # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unreachable Call" language=c # Misra2004:14.1: There shall be no unreachable code # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unreachable Computation" language=c # Misra2004:14.1: There shall be no unreachable code # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unreachable Conditional" language=c # Misra2004:14.1: There shall be no unreachable code WARNING_FILTER += allow class="Unreachable Control Flow" language=c # Misra2004:14.1: There shall be no unreachable code # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unreachable Data Flow" language=c # Misra2004:4.1: Only those escape sequences that are defined in the ISO C standard shall be used # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unrecognized Character Escape" language=c # Misra2004:14.2: All non-null statements shall either (a) have at least one side-effect however executed, or (b) cause control flow to change # This check is enabled by default for the language(s) C, C++, x86, x86_64 # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Unused Value" language=c # Misra2004:3.4: All uses of the #pragma directive shall be documented and explained WARNING_FILTER += allow class="Use of #pragma" language=c # Misra2004:19.6: #undef shall not be used WARNING_FILTER += allow class="Use of #undef" language=c # Misra2004:20.7: The setjmp macro and the longjmp function shall not be used WARNING_FILTER += allow class="Use of " language=c # Misra2004:20.8: The signal handling facilities of shall not be used WARNING_FILTER += allow class="Use of " language=c # Misra2004:20.9: The input/output library shall not be used in production code WARNING_FILTER += allow class="Use of Input/Output" language=c # Misra2004:20.9: The input/output library shall not be used in production code WARNING_FILTER += allow class="Use of Input/Output Macro" language=c # Misra2004:20.4: Dynamic heap memory allocation shall not be used WARNING_FILTER += allow class="Use of Allocator/Deallocator" language=c # Misra2004:20.4: Dynamic heap memory allocation shall not be used WARNING_FILTER += allow class="Use of Allocator/Deallocator Macro" language=c # Misra2004:20.12: The time handling functions of library shall not be used WARNING_FILTER += allow class="Use of Time/Date Function" language=c # Misra2004:20.9: The input/output library shall not be used in production code WARNING_FILTER += allow class="Use of Input/Output" language=c # Misra2004:20.9: The input/output library shall not be used in production code WARNING_FILTER += allow class="Use of Input/Output Macro" language=c # Misra2004:12.10: The comma operator shall not be used WARNING_FILTER += allow class="Use of Comma Operator" language=c # Misra2004:20.11: The library functions abort, exit, getenv and system from library shall not be used WARNING_FILTER += allow class="Use of abort" language=c # Misra2004:20.10: The library functions atof, atoi and atol from library shall not be used WARNING_FILTER += allow class="Use of atof" language=c # Misra2004:20.10: The library functions atof, atoi and atol from library shall not be used WARNING_FILTER += allow class="Use of atoi" language=c # Misra2004:20.10: The library functions atof, atoi and atol from library shall not be used WARNING_FILTER += allow class="Use of atol" language=c # Misra2004:20.10: The library functions atof, atoi and atol from library shall not be used WARNING_FILTER += allow class="Use of atoll" language=c # Misra2004:20.11: The library functions abort, exit, getenv and system from library shall not be used WARNING_FILTER += allow class="Use of exit" language=c # Misra2004:20.11: The library functions abort, exit, getenv and system from library shall not be used WARNING_FILTER += allow class="Use of getenv" language=c # Misra2004:20.7: The setjmp macro and the longjmp function shall not be used WARNING_FILTER += allow class="Use of longjmp" language=c # Misra2004:20.6: The macro offsetof, in library , shall not be used WARNING_FILTER += allow class="Use of offsetof" language=c # Misra2004:17.6: The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist WARNING_FILTER += allow class="Use of putenv" language=c # Misra2004:20.4: Dynamic heap memory allocation shall not be used WARNING_FILTER += allow class="Use of realloc" language=c # Misra2004:20.7: The setjmp macro and the longjmp function shall not be used WARNING_FILTER += allow class="Use of setjmp" language=c # Misra2004:20.11: The library functions abort, exit, getenv and system from library shall not be used WARNING_FILTER += allow class="Use of system" language=c # Misra2004:14.2: All non-null statements shall either (a) have at least one side-effect however executed, or (b) cause control flow to change # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Useless Assignment" language=c # Misra2004:6.5: Bit fields of signed type shall be at least 2 bits long # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="Zero Length Bit Field Must Be Unnamed" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="cosh on High Number" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="cosh on Low Number" language=c # Misra2004:20.3: The validity of values passed to library functions shall be checked # This check is enabled by default for the language(s) C, C++ # It may remain in effect even if the following line is commented out. WARNING_FILTER += allow class="sqrt on Negative Value" language=c # # The remainder of this file was generated from template 'codesonar/presets/misra2004_inc.conf.in' # WARNING_FILTER += discard class="Basic Numerical Type Used" line_contents=~\<(main|argc|argv)\>