Rule Enforcement Report

This report lists all rules, grouping by "Advisory" or "Mandatory" or "Required" and whether enforced.

Enforced Rules - Advisory

Rule IdRuleEnforcement
Rule-1.2Language extensions should not be used0240, 0241, 0246, 0551, 0601, 0633, 0635, 0660, 0662, 0830, 0831, 0899, 1001, 1002, 1003, 1006, 1008, 1012, 1014, 1015, 1019, 1020, 1021, 1022, 1026, 1028, 1029, 1034, 1035, 1036, 1037, 1038, 1041, 1042, 1043, 1044, 1045, 1046, 3664
Rule-2.6A function should not contain unused label declarations3202
Rule-2.7There should be no unused parameters in functions3206
Rule-4.2Trigraphs should not be used3601
Rule-5.9Identifiers that define objects or functions with internal linkage should be unique1525, 1527, 1528
Rule-8.7Functions and objects should not be defined with external linkage if they are referenced in only one translation unit1504, 1505
Rule-8.9An object should be defined at block scope if its identifier only appears in a single function1514, 3218
Rule-8.11When an array with external linkage is declared, its size should be explicitly specified3684
Rule-8.13A pointer should point to a const-qualified type whenever possible3673
Rule-10.5The value of an expression should not be cast to an inappropriate essential type4301, 4302, 4303, 4304, 4305, 4310, 4312, 4315, 4320, 4322, 4330, 4332, 4340, 4342, 4350, 4351, 4352
Rule-11.4A conversion should not be performed between a pointer to object and an integer type0303, 0306, 0360, 0361, 0362
Rule-11.5A conversion should not be performed from pointer to void into pointer to object0316, 0317
Rule-12.1The precedence of operators within expressions should be made explicit3389, 3391, 3392, 3394, 3395, 3396, 3397
Rule-12.3The comma operator should not be used3417, 3418
Rule-12.4Evaluation of constant expressions should not lead to unsigned integer wrap-around2910
Rule-13.3A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator3440
Rule-13.4The result of an assignment operator should not be used3226, 3326
Rule-15.1The goto statement should not be used2001
Rule-15.4There should be no more than one break or goto statement used to terminate any iteration statement0771
Rule-15.5A function should have a single point of exit at the end2889
Rule-18.4The +, -, += and -= operators should not be applied to an expression of pointer type0488
Rule-18.5Declarations should contain no more than two levels of pointer nesting3260, 3261, 3262, 3263
Rule-19.2The union keyword should not be used0750, 0759
Rule-20.1#include directives should only be preceded by preprocessor directives or comments5087
Rule-20.5#undef should not be used0841
Rule-20.10The # and ## preprocessor operators should not be used0341, 0342
Rule-21.12The exception handling features of <fenv.h> should not be used5136

Count of enforced Advisory rules = 27

Unenforced Rules - Advisory

Rule IdRule
Rule-2.3A project should not contain unused type declarations
Rule-2.4A project should not contain unused tag declarations
Rule-2.5A project should not contain unused macro declarations
Rule-17.5The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elements
Rule-17.8A function parameter should not be modified

Count of unenforced Advisory rules = 5

Not Statically Enforceable Rules - Advisory

Rule IdRule
Dir-4.2All usage of assembly language should be documented
Dir-4.4Sections of code should not be "commented out"
Dir-4.5Identifiers in the same name space with overlapping visibility should be typographically unambiguous
Dir-4.6typedefs that indicate size and signedness should be used in place of the basic numerical types
Dir-4.8If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hidden
Dir-4.9A function should be used in preference to a function-like macro where they are interchangeable
Dir-4.13Functions which are designed to provide operations on a resource should be called in an appropriate sequence

Count of not statically enforceable Advisory rules = 7

Enforced Rules - Mandatory

Rule IdRuleEnforcement
Rule-9.1The value of an object with automatic storage duration shall not be read before it has been set2883, 2961, 2962, 2971, 2972
Rule-13.6The operand of the sizeof operator shall not contain any expression which has potential side-effects3307
Rule-17.3A function shall not be declared implicitly3335
Rule-17.4All exit paths from a function with non-void return type shall have an explicit return statement with an expression0745, 2887, 2888, 3113, 3114
Rule-19.1An object shall not be assigned or copied to an overlapping object2776, 2777

Count of enforced Mandatory rules = 5

Unenforced Rules - Mandatory

Rule IdRule
Rule-17.6The declaration of an array parameter shall not contain the static keyword between the [ ]
Rule-22.2A block of memory shall only be freed if it was allocated by means of a Standard Library function
Rule-22.4There shall be no attempt to write to a stream which has been opened as read-only
Rule-22.5A pointer to a FILE object shall not be dereferenced
Rule-22.6The value of a pointer to a FILE shall not be used after the associated stream has been closed

Count of unenforced Mandatory rules = 5

Enforced Rules - Required

Rule IdRuleEnforcement
Rule-1.1The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits0232, 0233, 0244, 0261, 0321, 0322, 0338, 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, 0554, 0555, 0556, 0557, 0558, 0559, 0560, 0561, 0562, 0563, 0564, 0565, 0580, 0588, 0589, 0590, 0591, 0605, 0616, 0619, 0620, 0621, 0622, 0627, 0628, 0629, 0631, 0638, 0640, 0641, 0642, 0643, 0644, 0645, 0646, 0649, 0650, 0651, 0653, 0655, 0656, 0657, 0659, 0664, 0665, 0671, 0673, 0674, 0675, 0677, 0682, 0683, 0684, 0685, 0690, 0698, 0699, 0708, 0709, 0736, 0737, 0738, 0746, 0747, 0755, 0756, 0757, 0758, 0766, 0767, 0768, 0774, 0775, 0801, 0802, 0803, 0804, 0811, 0812, 0821, 0834, 0835, 0844, 0845, 0851, 0852, 0856, 0866, 0873, 0877, 0940, 0941, 0943, 0944, 1023, 1024, 1025, 1033, 1047, 1048, 3236, 3237, 3238, 3244
Rule-1.3There shall be no occurrence of undefined or critical unspecified behaviour0160, 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, 1331, 1332, 1333, 1509, 1510, 2800, 2810, 2820, 2830, 2840, 3113, 3114, 3239, 3311, 3312, 3319, 3320, 3437, 3438
Rule-2.1A project shall not contain unreachable code0594, 1460, 1503, 2742, 2744, 2880, 2882, 3219
Rule-2.2There shall be no dead code2980, 2981, 2982, 2983, 2984, 2985, 2986, 2995, 2996, 3110, 3112, 3425, 3426, 3427
Rule-3.1The character sequences /* and // shall not be used within a comment.3108, 5133
Rule-3.2Line-splicing shall not be used in // comments.5134
Rule-5.1External identifiers shall be distinct0777
Rule-5.2Identifiers declared in the same scope and name space shall be distinct0779
Rule-5.3An identifier declared in an inner scope shall not hide an identifier declared in an outer scope2547, 3334
Rule-5.6A typedef name shall be a unique identifier1506, 1507, 1508, 3448
Rule-5.8Identifiers that define objects or functions with external linkage shall be unique1525, 1526
Rule-6.1Bit-fields shall only be declared with an appropriate type0634, 0635
Rule-6.2Single-bit named bit fields shall not be of a signed type3660, 3665
Rule-7.1Octal constants shall not be used0336, 0339, 3628
Rule-7.2A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type1281
Rule-7.3The lowercase character "l" shall not be used in a literal suffix1280
Rule-7.4A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"0752, 0753
Rule-8.1Types shall be explicitly specified2050, 2051
Rule-8.2Function types shall be in prototype form with named parameters1335, 1336, 3001, 3002, 3007
Rule-8.3All declarations of an object or function shall use the same names and type qualifiers0624, 1330, 3675
Rule-8.4A compatible declaration shall be visible when an object or function with external linkage is defined3408
Rule-8.5An external object or function shall be declared once in one and only one file1513, 3221, 3222, 3447, 3451
Rule-8.6An identifier with external linkage shall have exactly one external definition0630, 1509, 3406
Rule-8.8The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage3224
Rule-8.10An inline function shall be declared with the static storage class3240, 3243
Rule-8.14The restrict type qualifier shall not be used5137
Rule-9.2The initializer for an aggregate or union shall be enclosed in braces0693, 0694
Rule-9.3Arrays shall not be partially initialized0686
Rule-10.1Operands shall not be of an inappropriate essential type.3101, 3102, 4500, 4501, 4502, 4503, 4504, 4505, 4507, 4510, 4511, 4512, 4513, 4514, 4518, 4519, 4521, 4522, 4523, 4524, 4527, 4528, 4529, 4532, 4533, 4534, 4538, 4539, 4542, 4543, 4544, 4548, 4549, 4558, 4559, 4568, 4569
Rule-10.2Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations1810, 1811, 1812, 1813
Rule-10.3The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.0570, 0572, 1257, 1264, 1265, 1266, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 2850, 2851, 2852, 2900, 2901, 2902, 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, 4450, 4451, 4452, 4453, 4454, 4460, 4461, 4462, 4463, 4464, 4465
Rule-10.4Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category1800, 1802, 1803, 1804, 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
Rule-10.6The value of a composite expression shall not be assigned to an object with wider essential type4490, 4491, 4492, 4499
Rule-10.7If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type1890, 1891, 1892, 1893, 1894, 1895, 4397
Rule-10.8The value of a composite expression shall not be cast to a different essential type category or a wider essential type4390, 4391, 4392, 4393, 4394, 4395, 4398, 4399
Rule-11.1Conversions shall not be performed between a pointer to a function and any other type0302, 0305, 0307, 0313
Rule-11.2Conversions shall not be performed between a pointer to an incomplete type and any other type0308
Rule-11.3A cast shall not be performed between a pointer to object type and a pointer to a different object type0310, 3305
Rule-11.6A cast shall not be performed between pointer to void and an arithmetic type0306
Rule-11.7A cast shall not be performed between pointer to object and a non-integer arithmetic type0301
Rule-11.8A cast shall not remove any const or volatile qualification from the type pointed to by a pointer0311, 0312
Rule-11.9The macro NULL shall be the only permitted form of integer null pointer constant3003, 3004
Rule-12.2The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand0499, 2790
Rule-13.2The value of an expression and its persistent side-effects shall be the same under all permitted evaluation orders0400, 0401, 0402, 0403
Rule-13.5The right hand operand of a logical && or || operator shall not contain persistent side effects3415
Rule-14.1A loop counter shall not have essentially floating type3340, 3342
Rule-14.2A for loop shall be well-formed2461, 2462, 2463, 2464, 2467, 2469, 2471, 2472
Rule-14.3Controlling expressions shall not be invariant2990, 2991, 2992, 2993, 2994
Rule-14.4The controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean type3344
Rule-15.3Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statement3311
Rule-15.6The body of an iteration-statement or a selection-statement shall be a compound-statement2212, 2214, 3402
Rule-15.7All if ... else if constructs shall be terminated with an else statement2004
Rule-16.1All switch statements shall be well-formed2008, 3234
Rule-16.2A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement2019
Rule-16.3An unconditional break statement shall terminate every switch-clause2003, 2020
Rule-16.4Every switch statement shall have a default label2002
Rule-16.5A default label shall appear as either the first or the last switch label of a switch statement2009
Rule-16.6Every switch statement shall have at least two switch-clauses3315
Rule-16.7A switch-expression shall not have essentially Boolean type0735
Rule-17.1The features of <stdarg.h> shall not be used1337, 5130
Rule-17.2Functions shall not call themselves, either directly or indirectly1520, 3670
Rule-17.7The value returned by a function having non-void return type shall be used3200
Rule-18.1A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand2930, 2931, 2932
Rule-18.2Subtraction between pointers shall only be applied to pointers that address elements of the same array2771, 2772
Rule-18.3The relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same object2771, 2772
Rule-18.6The address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to exist3217, 3225, 3230, 4140
Rule-18.8Variable-length array types shall not be used0945, 1051, 1052
Rule-20.2The ', " or \ characters and the /* or // character sequences shall not occur in a header file name0813, 0814, 0831
Rule-20.3The #include directive shall be followed by either a <filename> or "filename" sequence0809
Rule-20.4A macro shall not be defined with the same name as a keyword3439
Rule-20.6Tokens that look like a preprocessing directive shall not occur within a macro argument0853
Rule-20.7Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses3410
Rule-20.9All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation3332
Rule-20.13A line whose first token is # shall be a valid preprocessing directive3115
Rule-20.14All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related3317, 3318
Rule-21.1#define and #undef shall not be used on a reserved identifier or reserved macro name0836, 0848, 0854, 4600, 4601
Rule-21.2A reserved identifier or macro name shall not be declared0602, 4602, 4603, 4604, 4605, 4606, 4607, 4608
Rule-21.3The memory allocation and deallocation functions of <stdlib.h> shall not be used5118
Rule-21.4The standard header file <setjmp.h> shall not be used5132
Rule-21.5The standard header file <signal.h> shall not be used5123
Rule-21.6The Standard Library input/output functions shall not be used5124
Rule-21.7The atof, atoi, atol and atoll functions of <stdlib.h> shall not be used5125
Rule-21.8The library functions abort, exit, getenv and system of <stdlib.h> shall not be used5126
Rule-21.9The library functions bsearch and qsort of <stdlib.h> shall not be used5135
Rule-21.10The Standard Library time and date functions shall not be used5127
Rule-21.11The standard header file <tgmath.h> shall not be used5131

Count of enforced Required rules = 86

Unenforced Rules - Required

Rule IdRule
Rule-4.1Octal and hexadecimal escape sequences shall be terminated
Rule-5.4Macro identifiers shall be distinct
Rule-5.5Identifiers shall be distinct from macro names
Rule-5.7A tag name shall be a unique identifier
Rule-8.12Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
Rule-9.4An element of an object shall not be initialized more than once
Rule-9.5Where designated initializers are used to initialize an array object the size of the array shall be specified explicitly
Rule-13.1Initializer lists shall not contain persistent side-effects
Rule-15.2The goto statement shall jump to a label declared later in the same function
Rule-18.7Flexible array members shall not be declared
Rule-20.8The controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1
Rule-20.11A macro parameter immediately following a # operator shall not immediately be followed by a ## operator
Rule-20.12A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators
Rule-22.1All resources obtained dynamically by means of Standard Library functions shall be explicitly released
Rule-22.3The same file shall not be open for read and write access at the same time on different streams

Count of unenforced Required rules = 15

Not Statically Enforceable Rules - Required

Rule IdRule
Dir-1.1Any implementation-defined behaviour on which the output of the program depends shall be documented and understood
Dir-2.1All source files shall compile without any compilation errors
Dir-3.1All code shall be traceable to documented requirements
Dir-4.1Run-time failures shall be minimized
Dir-4.3Assembly language shall be encapsulated and isolated
Dir-4.7If a function returns error information, then that error information shall be tested
Dir-4.10Precautions shall be taken in order to prevent the contents of a header file being included more then once
Dir-4.11The validity of values passed to library functions shall be checked
Dir-4.12Dynamic memory allocation shall not be used

Count of not statically enforceable Required rules = 9

Rule Enforcement Summary

(a) Total Number of Rules159
(b) Total Number of 'Not Statically Enforceable' Rules16
(c) Total Number of Enforceable Rules (a-b)143
(d) Total Number of Enforced Rules118
(e) Total Number of Unenforced Rules (c-d)25
(f) Enforced Rules Percentage (d/c)83 %
(g) Unenforced Rules Percentage (e/c)17 %

End of report