TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

Category: DECLARATIONS

Synopsis:


Description:

Coding Rules

NameCheckedSynopsis
8#1 Checked automatically with code checker Any specifiers present should appear in the following order: typedef, storage-class-specifier, type-specifier.
8.1#1 Checked automatically with code checker The address of an array declared with register is undefined and shall not be used.
8.1#2 Checked automatically with code checker Since auto is almost always redundant it shall be omitted to avoid cluttering up declarations.
8.1#3 Checked automatically with code checker register is a hint to the compiler.
8.2#1 Checked automatically with code checker const and volatile, if present, should appear before other type-specifiers.
8.3#1 Use of a tag must agree with its declaration
8.3#2 Checked automatically with code checker The concept of union whereby different kinds of data can be manipulated in a single area of storage is allowed only as the solution to certain kinds of problem but caution is urged in its use.
8.3#3 Checked automatically with code checker Bit fields must be of type int, signed or unsigned int only.
8.3#4 Checked automatically with code checker Do not use bit fields.
8.3#5 Checked automatically with code checker Signed bit-fields must not be of size 1.
8.3#6 Checked automatically with code checker The use of typedef to declare a struct or union is strongly recommended.
8.4#1 Checked automatically with code checker Only the first member of an enum may be explicitly initialised, if any, unless all items are explicitly initialised.
8.4#2 Checked automatically with code checker enum should be used with caution.
8.6.2#1 Checked automatically with code checker An array base type must not have function type.
8.6.2#2 Checked automatically with code checker Arrays must not be constructed from incomplete types.
8.6.3#1 Checked automatically with code checker Function prototype declarations and definitions of user-supplied functions shall be used
8.6.3#2 Checked automatically with code checker Function return types shall be explicitly given.
8.6.3#3 Checked automatically with code checker Pointers to functions should be declared and indirected using a typedef.
8.7#1 Checked automatically with code checker The initialiser for a struct, union or array bound, must be enclosed in braces.
8.7#2 Initialisers for a struct or union must have compatible type
8.7#4 Checked automatically with code checker For nested initialisers, the braces should match the structure.
8.9#1 Checked automatically with code checker An identifier declared as a typedef, must not be redeclared in an inner scope without a type specifier.
8.9#2 Checked automatically with code checker An identifier declared as a typedef, must not be redeclared as a member of a struct or union without a type specifier.