Next: 15 Structures, Unions and Enumerations  Up: index  Previous: 13 Portability  Contents

14 Pre-processor

14.1

High Integrity CPP Rule

Use the C++ comment delimiters "//". Do not use the C comment delimiters "/* ... */".

14.2

High Integrity CPP Guideline

Do not use tab characters in source files.

14.3

High Integrity CPP Guideline

Write pre-processor directives to begin in column 1 with no whitespace between the '#' and the pre-processor directive.

14.4

High Integrity CPP Guideline

Write pre-processor directives to begin in column 1 with whitespace between the '#' and the pre-processor directive representing nesting in preprocessor conditionals.

14.5

High Integrity CPP Rule

Control conditional compilation by the use of, or absence of, a pre-processor token definition.

14.6

High Integrity CPP Rule

Use the '__cplusplus' identifier to distinguish between C and C++ compilation.

14.7

High Integrity CPP Guideline

Do not include comment text in the definition of a pre-processor macro.

14.8

High Integrity CPP Rule

Ensure that the last line of all files containing source code is followed by a new-line.

14.9

High Integrity CPP Rule

Use <> brackets for system and standard library headers. Use "" quotes for all other headers.

14.10

High Integrity CPP Rule

Do not include a path specifier in file names supplied in #include directives.

14.11

High Integrity CPP Rule

Incorporate include guards in header files to prevent multiple inclusions of the same file.

14.12

High Integrity CPP Rule

Use lower-case for file names and references to file names (such as include directives).

14.13

High Integrity CPP Rule

Write header files such that all files necessary for their compilation are included.

14.14

High Integrity CPP Rule

Enclose macro arguments and body in parentheses.

14.15

High Integrity CPP Rule

Do not use pre-processor macros to define code segments.

14.16

High Integrity CPP Rule

Do not use the NULL macro.

14.17

High Integrity CPP Rule

Use const objects or enumerators to define constants, not #define.

14.18

High Integrity CPP Rule

Do not use digraphs or trigraphs.

14.19

High Integrity CPP Rule

Do not use function macros, use inline functions instead.


HICPP VERSION 2.4  http://www.codingstandard.com   Copyright: © 2007 THE PROGRAMMING RESEARCH GROUP