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

Category: Declarations

Synopsis:Rules about declarations


Description:

Coding Rules

NameCheckedSynopsis
6.7.a Checked automatically with code checker Only one identifier type shall be declared on each source line.
6.7.1.a Checked automatically with code checker Identifiers with file scope shall be declared static, thus preventing them from having global scope.
6.7.1.b Checked automatically with code checker Since auto is redundant it shall be omitted to avoid cluttering up declarations.
6.7.1.c Checked automatically with code checker Since "register" is redundant it shall be omitted to avoid cluttering up declarations.
6.7.2.a Checked automatically with code checker Compiler-specific extensions shall not be used in type specifiers.
6.7.2.b Checked automatically with code checker Every identifier declaration shall include a type specifier.
6.7.2.1.a Checked automatically with code checker Do not use bit-fields for combining multiple logical values in one memory location.
6.7.2.2.a Checked automatically with code checker Mixing of different enum types is not allowed.
6.7.3.a "const" shall be used to specify that a variable is non-modifiable.
6.7.5.a Checked automatically with code checker Only variables and parameters that are used shall be declared.
6.7.5.2.a Checked automatically with code checker Array bounds shall be specified as integral constant expressions.
6.7.5.3.a All function prototypes shall specify the type and the name of each of their parameters.
6.7.5.3.b Checked automatically with code checker A function shall only be used if its prototype is known.
6.7.8.a Checked automatically with code checker All variables shall be initialized or assigned before being read.
6.7.8.b Checked automatically with code checker The initializer for a struct, union or array shall be enclosed in braces.
6.7.8.c Checked automatically with code checker For a struct the initializer should be {0} or all fields should be initialized.
6.7.8.d Checked automatically with code checker All variables containing a pointer shall be initialized.