Cross reference listing of MISRA-C:2004 Rules against messages generated
copyright: © 2013 Programming Research
MISRA-C:2004 Rule 1.1 (Required)
All code shall conform to ISO/IEC 9899:1990 C programming
language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995,
ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192
QAC Messages: 0180, 0232, 0233, 0240, 0241, 0244, 0246, 0261, 0320, 0321, 0322, 0338, 0410, 0422, 0423, 0426, 0427, 0429, 0430, 0431, 0432, 0435, 0436, 0437, 0446, 0447, 0448, 0449, 0450, 0451, 0452, 0453, 0454, 0456, 0457, 0458, 0466, 0467, 0468, 0469, 0476, 0477, 0478, 0481, 0482, 0483, 0484, 0485, 0486, 0487, 0493, 0494, 0495, 0496, 0513, 0514, 0515, 0536, 0537, 0540, 0541, 0542, 0546, 0547, 0550, 0551, 0554, 0555, 0556, 0557, 0558, 0559, 0560, 0561, 0562, 0563, 0564, 0565, 0580, 0588, 0589, 0590, 0591, 0601, 0604, 0605, 0609, 0611, 0612, 0614, 0616, 0617, 0618, 0619, 0620, 0621, 0622, 0627, 0628, 0629, 0631, 0633, 0635, 0638, 0639, 0640, 0641, 0642, 0643, 0644, 0645, 0646, 0647, 0649, 0650, 0651, 0653, 0655, 0656, 0657, 0659, 0660, 0662, 0664, 0665, 0671, 0673, 0674, 0675, 0677, 0682, 0683, 0684, 0685, 0690, 0698, 0699, 0708, 0709, 0715, 0736, 0737, 0738, 0739, 0746, 0747, 0755, 0756, 0757, 0758, 0766, 0767, 0768, 0774, 0775, 0801, 0802, 0803, 0804, 0810, 0811, 0812, 0821, 0828, 0830, 0831, 0834, 0835, 0844, 0845, 0850, 0851, 0852, 0856, 0857, 0858, 0859, 0866, 0873, 0875, 0877, 0899, 0930, 0940, 0941, 0943, 0944, 0945, 1001, 1002, 1003, 1006, 1008, 1011, 1012, 1014, 1015, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1051, 1052, 1053, 1054, 1055, 1056, 3236, 3237, 3238, 3244, 3664
Enforcement: QAC
MISRA-C:2004 Rule 1.2 (Required)
No reliance shall be placed on undefined or unspecified behaviour.
QAC Messages: 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, 0168, 0169, 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177, 0178, 0179, 0184, 0185, 0186, 0190, 0191, 0192, 0193, 0194, 0195, 0196, 0197, 0198, 0199, 0200, 0201, 0203, 0204, 0206, 0207, 0208, 0235, 0275, 0301, 0302, 0304, 0307, 0309, 0337, 0400, 0401, 0402, 0403, 0475, 0543, 0544, 0545, 0602, 0623, 0625, 0626, 0630, 0632, 0636, 0654, 0658, 0661, 0667, 0668, 0672, 0676, 0678, 0680, 0706, 0745, 0777, 0779, 0809, 0813, 0814, 0836, 0837, 0848, 0853, 0854, 0864, 0865, 0867, 0872, 0874, 0885, 0887, 0888, 0914, 0915, 0942, 1509, 1510, 2800, 2810, 2820, 2830, 2840, 3113, 3114, 3239, 3311, 3312, 3319, 3437, 3438
Enforcement: QAC and CMA
MISRA-C:2004 Rule 1.3 (Required)
Multiple compilers and/or languages shall only be used if there is a common defined interface standard for object code to which the languages/compilers/assemblers conform.
Enforcement: NSE (Not Statically Enforceable)
MISRA-C:2004 Rule 1.4 (Required)
The compiler/linker shall be checked to ensure that 31 character significance and case sensitivity are supported for external identifiers.
Enforcement: NSE
MISRA-C:2004 Rule 1.5 (Advisory)
Floating-point implementations should comply with a defined floating-point standard.
Enforcement: NSE
MISRA-C:2004 Rule 2.1 (Required)
Assembly language shall be encapsulated and isolated.
QAC Messages: 3006
Enforcement: QAC
MISRA-C:2004 Rule 2.2 (Required)
Source code shall only use C-style comments.
QAC Messages: 1011
Enforcement: QAC
MISRA-C:2004 Rule 2.3 (Required)
The character sequence /* shall not be used within a comment.
QAC Messages: 3108
Enforcement: QAC
MISRA-C:2004 Rule 2.4 (Advisory)
Sections of code should not be 'commented out'.
Enforcement: NSE
MISRA-C:2004 Rule 3.1 (Required)
All usage of implementation-defined behaviour shall be documented.
QAC Messages: 0202, 0284, 0285, 0286, 0287, 0288, 0289, 0292, 0299, 0303, 0305, 0306, 0308, 0581, 0634, 0878, 2850, 2851, 2852, 2853, 2855, 2856, 2857, 2860, 2861, 2862, 2890, 2895
Enforcement: QAC and Dataflow
MISRA-C:2004 Rule 3.2 (Required)
The character set and the corresponding encoding shall be documented.
Enforcement: NSE
MISRA-C:2004 Rule 3.3 (Advisory)
The implementation of integer division in the chosen compiler should be determined, documented and taken into account.
Enforcement: NSE
MISRA-C:2004 Rule 3.4 (Required)
All uses of the #pragma directive shall be documented and explained.
QAC Messages: 3116
Enforcement: QAC
MISRA-C:2004 Rule 3.5 (Required)
If it is being relied upon, the implementation-defined behaviour and packing of bitfields shall be documented.
Enforcement: NSE
MISRA-C:2004 Rule 3.6 (Required)
All libraries used in production code shall be written to comply with the provisions of this document, and shall have been subject to appropriate validation.
Enforcement: NSE
MISRA-C:2004 Rule 4.1 (Required)
Only those escape sequences that are defined in the ISO C standard shall be used.
QAC Messages: 0235, 3610
Enforcement: QAC
MISRA-C:2004 Rule 4.2 (Required)
Trigraphs shall not be used.
QAC Messages: 3601
Enforcement: QAC
MISRA-C:2004 Rule 5.1 (Required)
Identifiers (internal and external) shall not rely on the significance of more than 31 characters.
QAC Messages: 0777, 0779
Enforcement: QAC
MISRA-C:2004 Rule 5.2 (Required)
Identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide that identifier.
QAC Messages: 2547, 3334
Enforcement: QAC
MISRA-C:2004 Rule 5.3 (Required)
A typedef name shall be a unique identifier.
QAC Messages: 1506, 1507, 1508, 3448
Enforcement: QAC and CMA
MISRA-C:2004 Rule 5.4 (Required)
A tag name shall be a unique identifier.
QAC Messages: 0547
Enforcement: QAC
MISRA-C:2004 Rule 5.5 (Advisory)
No object or function identifier with static storage duration should be reused.
QAC Messages: 1525, 1526, 1527, 1528, 1529
Enforcement: CMA
MISRA-C:2004 Rule 5.6 (Advisory)
No identifier in one name space should have the same spelling as an identifier in another name space, with the exception of structure member and union member names.
QAC Messages: 0780, 0781
Enforcement: QAC
MISRA-C:2004 Rule 5.7 (Advisory)
No identifier name should be reused.
Enforcement: Not enforced
MISRA-C:2004 Rule 6.1 (Required)
The plain char type shall be used only for the storage and use of character values.
QAC Messages: 1810, 1811, 1812, 1813, 4401, 4421, 4431, 4441, 4451, 4510, 4511, 4512, 4513, 4514, 4517, 4518, 4519
Enforcement: QAC
MISRA-C:2004 Rule 6.2 (Required)
Signed and unsigned char type shall be used only for the storage and use of numeric values.
QAC Messages: 4413, 4414
Enforcement: QAC
MISRA-C:2004 Rule 6.3 (Advisory)
Typedefs that indicate size and signedness should be used in place of the basic numerical types.
QAC Messages: 5013
Enforcement: Secondary-analysis.
MISRA-C:2004 Rule 6.4 (Required)
Bit fields shall only be defined to be of type unsigned int or signed int.
QAC Messages: 0634, 0635
Enforcement: QAC
MISRA-C:2004 Rule 6.5 (Required)
Bit fields of signed type shall be at least 2 bits long.
QAC Messages: 3659, 3660, 3665
Enforcement: QAC
MISRA-C:2004 Rule 7.1 (Required)
Octal constants (other than zero) and octal escape sequences shall not be used.
QAC Messages: 0336, 0339, 3628
Enforcement: QAC
MISRA-C:2004 Rule 8.1 (Required)
Functions shall have prototype declarations and the prototype shall be visible at both the function definition and call.
QAC Messages: 3002, 3335, 3450
Enforcement: QAC
MISRA-C:2004 Rule 8.2 (Required)
Whenever an object or function is declared or defined, its type shall be explicitly stated.
QAC Messages: 2050, 2051
Enforcement: QAC
MISRA-C:2004 Rule 8.3 (Required)
For each function parameter the type given in the declaration and definition shall be identical, and the return types shall also be identical.
QAC Messages: 0624, 1331, 1332, 1333, 3320, 3675
Enforcement: QAC
MISRA-C:2004 Rule 8.4 (Required)
If objects or functions are declared more than once their types shall be compatible.
QAC Messages: 0626, 0627, 0628, 1510
Enforcement: QAC and CMA
MISRA-C:2004 Rule 8.5 (Required)
There shall be no definitions of objects or functions in a header file.
QAC Messages: 3406, 3480
Enforcement: QAC
MISRA-C:2004 Rule 8.6 (Required)
Functions shall be declared at file scope.
QAC Messages: 3221
Enforcement: QAC
MISRA-C:2004 Rule 8.7 (Required)
Objects shall be defined at block scope if they are only accessed from within a single function.
QAC Messages: 1514, 3218
Enforcement: QAC and CMA
MISRA-C:2004 Rule 8.8 (Required)
An external object or function shall be declared in one and only one file.
QAC Messages: 1513, 3222, 3408, 3447, 3451
Enforcement: QAC and CMA
MISRA-C:2004 Rule 8.9 (Required)
An identifier with external linkage shall have exactly one external definition.
QAC Messages: 0630, 1509
Enforcement: QAC and CMA
MISRA-C:2004 Rule 8.10 (Required)
All declarations and definitions of objects or functions at file scope shall have internal linkage unless external linkage is required.
QAC Messages: 1504, 1505
Enforcement: CMA
MISRA-C:2004 Rule 8.11 (Required)
The static storage class specifier shall be used in definitions and declarations of objects and functions that have internal linkage.
QAC Messages: 3224
Enforcement: QAC
MISRA-C:2004 Rule 8.12 (Required)
When an array is declared with external linkage, its size shall be stated explicitly or defined implicitly by initialisation.
QAC Messages: 3684
Enforcement: QAC
MISRA-C:2004 Rule 9.1 (Required)
All automatic variables shall have been assigned a value before being used.
QAC Messages: 2883, 2961, 2962, 2971, 2972
Enforcement: Dataflow
MISRA-C:2004 Rule 9.2 (Required)
Braces shall be used to indicate and match the structure in the non-zero initialisation of arrays and structures.
QAC Messages: 0686, 0693, 0694
Enforcement: QAC
MISRA-C:2004 Rule 9.3 (Required)
In an enumerator list, the '=' construct shall not be used to explicitly initialise members other than the first, unless all items are explicitly initialised.
QAC Messages: 0723
Enforcement: QAC
MISRA-C:2004 Rule 10.1 (Required)
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
QAC Messages: 0570, 0572, 1256, 1257, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1317, 1461, 1800, 1802, 1803, 1804, 1810, 1811, 1812, 1813, 1820, 1821, 1822, 1823, 1824, 1830, 1831, 1832, 1833, 1834, 1840, 1841, 1842, 1843, 1844, 1850, 1851, 1852, 1853, 1854, 1860, 1861, 1862, 1863, 1864, 1880, 1881, 1882, 1890, 1891, 2900, 4117, 4401, 4402, 4403, 4404, 4405, 4410, 4412, 4413, 4414, 4415, 4420, 4421, 4422, 4423, 4424, 4425, 4430, 4431, 4432, 4434, 4435, 4436, 4437, 4440, 4441, 4442, 4443, 4445, 4446, 4447, 4451, 4460, 4461, 4463, 4464, 4470, 4471, 4480, 4481, 4490, 4491, 4500, 4501, 4502, 4503, 4504, 4505, 4507
Enforcement: QAC
MISRA-C:2004 Rule 10.2 (Required)
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
QAC Messages: 1264, 1265, 1266, 1880, 1881, 1882, 1892, 1893, 1894, 1895, 4450, 4452, 4453, 4454, 4462, 4465, 4472, 4482, 4492
Enforcement: QAC
MISRA-C:2004 Rule 10.3 (Required)
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.
QAC Messages: 4118, 4390, 4391, 4393, 4394
Enforcement: QAC
MISRA-C:2004 Rule 10.4 (Required)
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.
QAC Messages: 4392, 4395
Enforcement: QAC
MISRA-C:2004 Rule 10.5 (Required)
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.
QAC Messages: 4397, 4398, 4399, 4498, 4499
Enforcement: QAC
MISRA-C:2004 Rule 10.6 (Required)
A "U" suffix shall be applied to all constants of unsigned type.
QAC Messages: 1281
Enforcement: QAC
MISRA-C:2004 Rule 11.1 (Required)
Conversions shall not be performed between a pointer to a function and any type other than an integral type.
QAC Messages: 0302, 0307, 0313
Enforcement: QAC
MISRA-C:2004 Rule 11.2 (Required)
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.
QAC Messages: 0301
Enforcement: QAC
MISRA-C:2004 Rule 11.3 (Advisory)
A cast should not be performed between a pointer type and an integral type.
QAC Messages: 0303, 0305, 0306, 0360, 0361, 0362
Enforcement: QAC
MISRA-C:2004 Rule 11.4 (Advisory)
A cast should not be performed between a pointer to object type and a different pointer to object type.
QAC Messages: 0310, 0316, 0317
Enforcement: QAC
MISRA-C:2004 Rule 11.5 (Required)
A cast shall not be performed that removes any const or volatile qualification from the type addressed by a pointer.
QAC Messages: 0311, 0312
Enforcement: QAC
MISRA-C:2004 Rule 12.1 (Advisory)
Limited dependence should be placed on C's operator precedence rules in expressions.
QAC Messages: 3389, 3391, 3392, 3393, 3394, 3395, 3396, 3397
Enforcement: QAC
MISRA-C:2004 Rule 12.2 (Required)
The value of an expression shall be the same under any order of evaluation that the standard permits.
QAC Messages: 0400, 0401, 0402, 0403
Enforcement: QAC
MISRA-C:2004 Rule 12.3 (Required)
The sizeof operator shall not be used on expressions that contain side effects.
QAC Messages: 3307
Enforcement: QAC
MISRA-C:2004 Rule 12.4 (Required)
The right hand operand of a logical && or || operator shall not contain side effects.
QAC Messages: 3415
Enforcement: QAC
MISRA-C:2004 Rule 12.5 (Required)
The operands of a logical && or || shall be primary-expressions.
QAC Messages: 3398, 3399, 3400
Enforcement: QAC
MISRA-C:2004 Rule 12.6 (Advisory)
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 ?:).
QAC Messages: 3322, 3377, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4112, 4113, 4114, 4115, 4116
Enforcement: QAC
MISRA-C:2004 Rule 12.7 (Required)
Bitwise operators shall not be applied to operands whose underlying type is signed.
QAC Messages: 4532, 4533
Enforcement: QAC
MISRA-C:2004 Rule 12.8 (Required)
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.
QAC Messages: 0499, 2790
Enforcement: QAC
MISRA-C:2004 Rule 12.9 (Required)
The unary minus operator shall not be applied to an expression whose underlying type is unsigned.
QAC Messages: 3101, 3102
Enforcement: QAC
MISRA-C:2004 Rule 12.10 (Required)
The comma operator shall not be used.
QAC Messages: 3417, 3418
Enforcement: QAC
MISRA-C:2004 Rule 12.11 (Advisory)
Evaluation of constant unsigned integer expressions should not lead to wrap-around.
QAC Messages: 2910
Enforcement: QAC
MISRA-C:2004 Rule 12.12 (Required)
The underlying bit representations of floating-point values shall not be used.
QAC Messages: 3629
Enforcement: QAC
MISRA-C:2004 Rule 12.13 (Advisory)
The increment (++) and decrement (--) operators should not be mixed with other operators in an expression.
QAC Messages: 3440
Enforcement: QAC
MISRA-C:2004 Rule 13.1 (Required)
Assignment operators shall not be used in expressions that yield a Boolean value.
QAC Messages: 3326
Enforcement: QAC
MISRA-C:2004 Rule 13.2 (Advisory)
Tests of a value against zero should be made explicit, unless the operand is effectively Boolean.
QAC Messages: 3344, 4528, 4529, 4538, 4539, 4548, 4549, 4558, 4559, 4568, 4569
Enforcement: QAC
MISRA-C:2004 Rule 13.3 (Required)
Floating-point expressions shall not be tested for equality or inequality.
QAC Messages: 3341
Enforcement: QAC
MISRA-C:2004 Rule 13.4 (Required)
The controlling expression of a for statement shall not contain any objects of floating type.
QAC Messages: 3340, 3342
Enforcement: QAC
MISRA-C:2004 Rule 13.5 (Required)
The three expressions of a for statement shall be concerned only with loop control.
QAC Messages: 2462, 2463
Enforcement: QAC
MISRA-C:2004 Rule 13.6 (Required)
Numeric variables being used within a for loop for iteration counting shall not be modified in the body of the loop.
QAC Messages: 2469
Enforcement: QAC
MISRA-C:2004 Rule 13.7 (Required)
Boolean operations whose results are invariant shall not be permitted.
QAC Messages: 2990, 2991, 2992, 2993, 2994, 2995, 2996
Enforcement: Dataflow
MISRA-C:2004 Rule 14.1 (Required)
There shall be no unreachable code.
QAC Messages: 0594, 1460, 1503, 2008, 2742, 2744, 2880, 2882, 3219
Enforcement: QAC and Dataflow
MISRA-C:2004 Rule 14.2 (Required)
All non-null statements shall either (i) have at least one side effect however executed, or (ii) cause control flow to change.
QAC Messages: 3110, 3112, 3425, 3426, 3427
Enforcement: QAC
MISRA-C:2004 Rule 14.3 (Required)
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.
QAC Messages: 3138
Enforcement: QAC
MISRA-C:2004 Rule 14.4 (Required)
The goto statement shall not be used.
QAC Messages: 2001
Enforcement: QAC
MISRA-C:2004 Rule 14.5 (Required)
The continue statement shall not be used.
QAC Messages: 0770
Enforcement: QAC
MISRA-C:2004 Rule 14.6 (Required)
For any iteration statement there shall be at most one break statement used for loop termination.
QAC Messages: 0771
Enforcement: QAC
MISRA-C:2004 Rule 14.7 (Required)
A function shall have a single point of exit at the end of the function.
QAC Messages: 2889
Enforcement: QAC
MISRA-C:2004 Rule 14.8 (Required)
The statement forming the body of a switch, while, do ... while or for statement shall be a compound statement.
QAC Messages: 2212, 2214
Enforcement: QAC
MISRA-C:2004 Rule 14.9 (Required)
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.
QAC Messages: 2212, 2214, 3402
Enforcement: QAC
MISRA-C:2004 Rule 14.10 (Required)
All if ... else if constructs shall be terminated with an else clause.
QAC Messages: 2004
Enforcement: QAC
MISRA-C:2004 Rule 15.0 (Required)
The MISRA C switch syntax shall be used.
QAC Messages: 3234
Enforcement: QAC
MISRA-C:2004 Rule 15.1 (Required)
A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement.
QAC Messages: 2019
Enforcement: QAC
MISRA-C:2004 Rule 15.2 (Required)
An unconditional break statement shall terminate every non-empty switch clause.
QAC Messages: 2003, 2020
Enforcement: QAC
MISRA-C:2004 Rule 15.3 (Required)
The final clause of a switch statement shall be the default clause.
QAC Messages: 2002, 2009
Enforcement: QAC
MISRA-C:2004 Rule 15.4 (Required)
A switch expression shall not represent a value that is effectively Boolean.
QAC Messages: 0735
Enforcement: QAC
MISRA-C:2004 Rule 15.5 (Required)
Every switch statement shall have at least one case clause.
QAC Messages: 3315
Enforcement: QAC
MISRA-C:2004 Rule 16.1 (Required)
Functions shall not be defined with a variable number of arguments.
QAC Messages: 1337
Enforcement: QAC
MISRA-C:2004 Rule 16.2 (Required)
Functions shall not call themselves, either directly or indirectly.
QAC Messages: 1520, 3670
Enforcement: QAC and CMA
MISRA-C:2004 Rule 16.3 (Required)
Identifiers shall be given for all of the parameters in a function prototype declaration.
QAC Messages: 1335, 1336
Enforcement: QAC
MISRA-C:2004 Rule 16.4 (Required)
The identifiers used in the declaration and definition of a function shall be identical.
QAC Messages: 1330
Enforcement: QAC
MISRA-C:2004 Rule 16.5 (Required)
Functions with no parameters shall be declared and defined with the parameter list void.
QAC Messages: 3001, 3007
Enforcement: QAC
MISRA-C:2004 Rule 16.6 (Required)
The number of arguments passed to a function shall match the number of parameters.
QAC Messages: 0422, 0423, 3319
Enforcement: QAC
MISRA-C:2004 Rule 16.7 (Advisory)
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.
QAC Messages: 3673
Enforcement: QAC
MISRA-C:2004 Rule 16.8 (Required)
All exit paths from a function with non-void return type shall have an explicit return statement with an expression.
QAC Messages: 0745, 2887, 2888, 3113, 3114
Enforcement: QAC
MISRA-C:2004 Rule 16.9 (Required)
A function identifier shall only be used with either a preceding &, or with a parenthesised parameter list, which may be empty.
QAC Messages: 3635
Enforcement: QAC
MISRA-C:2004 Rule 16.10 (Required)
If a function returns error information, then that error information shall be tested.
QAC Messages: 3200
Enforcement: QAC
MISRA-C:2004 Rule 17.1 (Required)
Pointer arithmetic shall only be applied to pointers that address an array or array element.
QAC Messages: 2930, 2931, 2932
Enforcement: QAC and Dataflow
MISRA-C:2004 Rule 17.2 (Required)
Pointer subtraction shall only be applied to pointers that address elements of the same array.
QAC Messages: 2771, 2772
Enforcement: Dataflow
MISRA-C:2004 Rule 17.3 (Required)
>, >=, <, <= shall not be applied to pointer types except where they point to the same array.
QAC Messages: 2771, 2772
Enforcement: Dataflow
MISRA-C:2004 Rule 17.4 (Required)
Array indexing shall be the only allowed form of pointer arithmetic.
QAC Messages: 0488, 0489, 0491, 0492
Enforcement: QAC
MISRA-C:2004 Rule 17.5 (Advisory)
The declaration of objects should contain no more than 2 levels of pointer indirection.
QAC Messages: 3260, 3261, 3262, 3263
Enforcement: QAC
MISRA-C:2004 Rule 17.6 (Required)
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.
QAC Messages: 3217, 3225, 3230, 4140
Enforcement: QAC
MISRA-C:2004 Rule 18.1 (Required)
All structure and union types shall be complete at the end of a translation unit.
QAC Messages: 0544, 0545, 0623, 0636
Enforcement: QAC
MISRA-C:2004 Rule 18.2 (Required)
An object shall not be assigned to an overlapping object.
QAC Messages: 2776, 2777
Enforcement: Dataflow
MISRA-C:2004 Rule 18.3 (Required)
An area of memory shall not be reused for unrelated purposes.
Enforcement: NSE
MISRA-C:2004 Rule 18.4 (Required)
Unions shall not be used.
QAC Messages: 0750, 0759
Enforcement: QAC
MISRA-C:2004 Rule 19.1 (Advisory)
#include statements in a file should only be preceded by other preprocessor directives or comments.
QAC Messages: 5087
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 19.2 (Advisory)
Non-standard characters should not occur in header file names in #include directives.
QAC Messages: 0813, 0814, 0831
Enforcement: QAC
MISRA-C:2004 Rule 19.3 (Required)
The #include directive shall be followed by either a <filename> or "filename" sequence.
QAC Messages: 0809
Enforcement: QAC
MISRA-C:2004 Rule 19.4 (Required)
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-while-zero construct.
QAC Messages: 3409, 3411, 3412, 3413, 3431, 3452, 3458, 3460, 3461
Enforcement: QAC
MISRA-C:2004 Rule 19.5 (Required)
Macros shall not be #define'd or #undef'd within a block.
QAC Messages: 0842
Enforcement: QAC
MISRA-C:2004 Rule 19.6 (Required)
#undef shall not be used.
QAC Messages: 0841
Enforcement: QAC
MISRA-C:2004 Rule 19.7 (Advisory)
A function should be used in preference to a function-like macro.
QAC Messages: 3453
Enforcement: QAC
MISRA-C:2004 Rule 19.8 (Required)
A function-like macro shall not be invoked without all of its arguments.
QAC Messages: 0850, 0856
Enforcement: QAC
MISRA-C:2004 Rule 19.9 (Required)
Arguments to a function-like macro shall not contain tokens that look like preprocessing directives.
QAC Messages: 0853
Enforcement: QAC
MISRA-C:2004 Rule 19.10 (Required)
In the definition of a function-like macro each instance of a parameter shall be enclosed in parentheses unless it is used as the operand of # or ##.
QAC Messages: 3410
Enforcement: QAC
MISRA-C:2004 Rule 19.11 (Required)
All macro identifiers in preprocessor directives shall be defined before use, except in #ifdef and #ifndef preprocessor directives and the defined() operator.
QAC Messages: 3332
Enforcement: QAC
MISRA-C:2004 Rule 19.12 (Required)
There shall be at most one occurrence of the # or ## preprocessor operators in a single macro definition.
QAC Messages: 0880, 0881, 0884
Enforcement: QAC
MISRA-C:2004 Rule 19.13 (Advisory)
The # and ## preprocessor operators should not be used.
QAC Messages: 0341, 0342
Enforcement: QAC
MISRA-C:2004 Rule 19.14 (Required)
The defined preprocessor operator shall only be used in one of the two standard forms.
QAC Messages: 0885, 0887, 0888
Enforcement: QAC
MISRA-C:2004 Rule 19.15 (Required)
Precautions shall be taken in order to prevent the contents of a header file being included twice.
QAC Messages: 0883
Enforcement: QAC
MISRA-C:2004 Rule 19.16 (Required)
Preprocessing directives shall be syntactically meaningful even when excluded by the preprocessor.
QAC Messages: 3115
Enforcement: QAC
MISRA-C:2004 Rule 19.17 (Required)
All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related.
QAC Messages: 3317, 3318
Enforcement: QAC
MISRA-C:2004 Rule 20.1 (Required)
Reserved identifiers, macros and functions in the standard library, shall not be defined, redefined or undefined.
QAC Messages: 0836, 0848, 0854, 3439, 4600, 4601
Enforcement: QAC
MISRA-C:2004 Rule 20.2 (Required)
The names of standard library macros, objects and functions shall not be reused.
QAC Messages: 0602, 4602, 4603, 4604, 4605, 4606, 4607, 4608
Enforcement: QAC
MISRA-C:2004 Rule 20.3 (Required)
The validity of values passed to library functions shall be checked.
QAC Messages: 2810, 2811, 2812, 2840, 2841, 2842
Enforcement: QAC and Dataflow
MISRA-C:2004 Rule 20.4 (Required)
Dynamic heap memory allocation shall not be used.
QAC Messages: 5118
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.5 (Required)
The error indicator errno shall not be used.
QAC Messages: 5119
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.6 (Required)
The macro offsetof, in library <stddef.h>, shall not be used.
QAC Messages: 5120
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.7 (Required)
The setjmp macro and the longjmp function shall not be used.
QAC Messages: 5122
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.8 (Required)
The signal handling facilities of <signal.h> shall not be used.
QAC Messages: 5123
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.9 (Required)
The input/output library <stdio.h> shall not be used in production code.
QAC Messages: 5124
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.10 (Required)
The library functions atof, atoi and atol from library <stdlib.h> shall not be used.
QAC Messages: 5125
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.11 (Required)
The library functions abort, exit, getenv and system from library <stdlib.h> shall not be used.
QAC Messages: 5126
Enforcement: Secondary-analysis
MISRA-C:2004 Rule 20.12 (Required)
The time handling functions of library <time.h> shall not be used.
QAC Messages: 5127
Enforcement: Secondary-analysis.
MISRA-C:2004 Rule 21.1 (Required)
Minimisation of run-time failures shall be ensured by the use of at least one of (a) static analysis tools/techniques; (b) dynamic analysis tools/techniques; (c) explicit coding of checks to handle run-time faults
QAC Messages: 2791, 2792, 2801, 2802, 2811, 2812, 2821, 2822, 2831, 2832, 2841, 2842, 2845, 2846, 2847, 2871, 2872, 2877, 2891, 2892, 2896, 2897, 2901, 2902, 2911, 2912, 2980, 2981, 2982, 2983, 2984, 2985, 2986
Enforcement: Dataflow