Excel
Excel
Rule 2
Rule 3
Rule 4
Rule 5
Rule 6
Rule 7
Rule 8
Rule 9
Rule 10
Rule 11
Rule 12
Rule 13
Rule 14
Rule 15
Rule 16
Rule 17
Rule 18
Rule 19
Rule 20
Rule 21
Rule 22
Rule 23
Rule 24
Rule 25
Rule 26
Rule 27
Rule 28
Rule 29
Rule 30
Rule 31
Rule 32
Rule 33
Rule 34
Rule 35
Rule 36
Rule 37
Rule 38
Rule 39
Rule 40
Rule 41
Rule 42
Rule 43
Rule 44
Rule 45
Rule 46
Rule 47
Rule 48
Rule 49
Rule 50
Rule 51
Rule 52
Rule 53
Rule 54
Rule 55
Rule 56
Rule 57
Rule 58
Rule 59
Rule 60
Rule 61
Rule 62
Rule 63
Rule 64
Rule 65
Rule 66
Rule 67
Rule 68
Rule 69
Rule 70
Rule 71
Rule 72
Rule 73
Rule 74
Rule 75
Rule 76
Rule 77
Rule 78
Rule 79
Rule 80
Rule 81
Rule 82
Rule 83
Rule 84
Rule 85
Rule 86
Rule 87
Rule 88
Rule 89
Rule 90
Rule 91
Rule 92
Rule 93
Rule 94
Rule 95
Rule 96
Rule 97
Rule 98
Rule 99
Rule 100
Rule 101
Rule 102
Rule 103
Rule 104
Rule 105
Rule 106
Rule 107
Rule 108
Rule 109
Rule 110
Rule 111
Rule 112
Rule 113
Rule 114
Rule 115
Rule 116
Rule 117
Rule 118
Rule 119
Rule 120
Rule 121
Rule 122
Rule 123
Rule 124
Rule 125
Rule 126
Rule 127
All code shall conform to ISO 9899 standard C, with no extensions permitted.
Code written in languages other than C should only be used if there is a defined interface standard for object code t
Assembly language functions that are called from C should be written as C functions containing only in-line assembl
Provision should be made for appropriate run-time checking.
Only those characters and escape sequences which are defined in the ISO C standard shall be used
Values of character types shall be restricted to a defined and documented subset of ISO 10646-1.
Trigraphs shall not be used.
Multibyte characters and wide string literals shall not be used.
Comments shall not be nested.
Sections of code should not be ‘commented out’.
Identifiers (internal and external) shall not rely on significance of more than 31 characters. Furthermore the compiler/
No identifier in one name space shall have the same spelling as an identifier in another name space.
The basic types of char, int, short, long, float and double should not be used, but specific-length equivalents should b
The type char shall always be declared as unsigned char or signed char.
Floating point implementations should comply with a defined floating point standard.
The underlying bit representations of floating point numbers shall not be used in any way by the programmer.
typedef names shall not be reused.
Numeric constants should be suffixed to indicate type, where an appropriate suffix is available.
Octal constants (other than zero) shall not be used.
All object and function identifiers shall be declared before use.
Identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide that ide
Declarations of objects should be at function scope unless a wider scope is necessary.
All declarations at file scope should be static where possible.
Identifiers shall not simultaneously have both internal and external linkage in the same translation unit.
An identifier with external linkage shall have exactly one external definition.
If objects or functions are declared more than once they shall have compatible declarations.
External objects should not be declared in more than one file.
The register storage class specifier should not be used.
The use of a tag shall agree with its declaration.
All automatic variables shall have been assigned a value before being used.
Braces shall be used to indicate and match the structure in the non-zero initialisation of arrays and structures.
In an enumerator list, the ‘=’construct shall not be used to explicitly initialise members other than the first, unless all
The right hand operand of a && or || operator shall not contain side effects.
The operands of a logical && or || shall be primary expressions.
Assignment operators shall not be used in expressions which return Boolean values.
Logical operators should not be confused with bitwise operators.
Bitwise operations shall not be performed on signed integer types.
The right hand operand of a shift operator shall lie between zero and one less than the width in bits of the left hand op
The unary minus operator shall not be applied to an unsigned expression.
The sizeof operator should not be used on expressions that contain side effects.
The implementation of integer division in the chosen compiler should be determined, documented and taken into acco
The comma operator shall not be used, except in the control expression of a for loop.
Implicit conversions which may result in a loss of information shall not be used.
Redundant explicit casts should not be used.
Type casting from any type to or from pointers shall not be used.
The value of an expression shall be the same under any order of evaluation that the standard permits.
No dependence should be placed on C’s operator precedence rules in expressions.
Mixed precision arithmetic should use explicit casting to generate the desired result.
Tests of a value against zero should be made explicit, unless the operand is effectively Boolean
Floating point variables shall not be tested for exact equality or inequality.
Evaluation of constant unsigned integer expressions should not lead to wrap-around.
There shall be no unreachable code.
All non-null statements shall have a side-effect.
A null statement shall only occur on a line by itself, and shall not have any other text on the same line.
Labels should not be used, except in switch statements.
The goto statement shall not be used.
The continue statement shall not be used.
The break statement shall not be used (except to terminate the cases of a switch statement).
The statements forming the body of an if, else if, else, while, do ... while or for statement shall always be enclosed in
All if, else if constructs should contain a final else clause.
Every non-empty case clause in a switch statement shall be terminated with a break statement.
All switch statements should contain a final default clause.
A switch expression should not represent a Boolean value.
Every switch statement shall have at least one case.
Floating point variables shall not be used as loop counters.
Only expressions concerned with loop control should appear within a for statement.
Numeric variables being used within a for loop for iteration counting should not be modified in the body of the loop.
Functions shall always be declared at file scope.
Functions with variable numbers of arguments shall not be used.
Functions shall not call themselves, either directly or indirectly.
Functions shall always have prototype declarations and the prototype shall be visible at both the function definition a
For each function parameter the type given in the declaration and definition shall be identical, and the return types sh
Identifiers shall either be given for all of the parameters in a function prototype declaration, or for none.
If identifiers are given for any of the parameters, then the identifiers used in the declaration and definition shall be ide
Every function shall have an explicit return type.
Functions with no parameters shall be declared with parameter type void.
The unqualified type of parameters passed to a function shall be compatible with the unqualified expected types defin
The number of parameters passed to a function shall match the function prototype.
The values returned by void functions shall not be used.
Void expressions shall not be passed as function parameters.
const qualification should be used on function parameters which are passed by reference, where it is intended that the
A function should have a single point of exit.
For functions with non-void return type: i) there shall be one return statement for every exit branch (including the end
For functions with void return type, return statements shall not have an expression.
Functions called with no parameters should have empty parentheses.
If a function returns error information, then that error information should be tested.
#include statements in a file shall only be preceded by other pre-processor directives or comments.
Non-standard characters shall not occur in header file names in #include directives.
The #include directive shall be followed by either a <filename> or "filename" sequence.
C macros shall only be used for symbolic constants, function-like macros, type qualifiers and storage class specifiers.
Macros shall not be #define’d and #undef’d within a block.
#undef should not be used.
A function should be used in preference to a function-like macro.
A function-like macro shall not be ‘called’without all of its arguments.
Arguments to a function-like macro shall not contain tokens that look like pre- processing directives.
In the definition of a function-like macro the whole definition, and each instance of a parameter, shall be enclosed in
Identifiers in pre-processor directives should be defined before use.
There shall be at most one occurrence of the # or ## pre-processor operators in a single macro definition.
All uses of the #pragma directive shall be documented and explained.
The defined pre-processor operator shall only be used in one of the two standard forms.
Pointer arithmetic should not be used.
No more than 2 levels of pointer indirection should be used.
Relational operators shall not be applied to pointer types except where both operands are of the same type and point t
Non-constant pointers to functions shall not be used.
All the functions pointed to by a single pointer to function shall be identical in the number and type of parameters a
The address of an object with automatic storage shall not be assigned to an object which may persist after the objec
The null pointer shall not be de-referenced.
In the specification of a structure or union type, all members of the structure or union shall be fully specified
Overlapping variable storage shall not be used.
Unions shall not be used to access the sub-parts of larger data types.
Bit fields shall only be defined to be of type unsigned int or signed int.
Bit fields of type signed int shall be at least 2 bits long.
All the members of a structure (or union) shall be named and shall only be accessed via their name.
Reserved words and standard library function names shall not be redefined or undefined.
Standard library function names shall not be reused.
All libraries used in production code shall be written to comply with the provisions of this document, and shall have b
The validity of values passed to library functions shall be checked.
Dynamic heap memory allocation shall not be used.
The error indicator errno shall not be used.
The macro offsetof, in library <stddef.h>, shall not be used.
<locale.h> and the setlocale function shall not be used.
The setjmp macro and the longjmp function shall not be used.
The signal handling facilities of <signal.h> shall not be used.
The input/output library <stdio.h> shall not be used in production code.
The library functions atof, atoi and atol from library <stdlib.h> shall not be used.
The library functions abort, exit, getenv and system from library <stdlib.h> shall not be used.
The time handling functions of library <time.h> shall not be used.