Name | Checked | Synopsis |
---|
12#1
|
 |
All identifiers used in preprocessor directives shall be defined. |
12#2
|
 |
Avoid esoteric aspects of preprocessing such as token pasting, text after #else or #endif, or relying on macro argument substitution within string literals. |
12.1#1
|
 |
Trigraphs shall not be used. |
12.1#2
|
 |
Avoid writing two adjacent question marks anywhere within your source code. |
12.3#1
|
 |
Always enclose any instances of macro parameters within parentheses. |
12.3#2
|
 |
If a macro body contains any operator, enclose it within parentheses. |
12.3#3
|
 |
Do not use macros to redefine keywords. |
12.3#4
|
 |
Avoid defining macros with unbalanced brackets or parentheses. |
12.3#5
|
 |
Macros should behave like symbolic constants or functions, (as function-like macros). |
12.3#6
|
|
Use const to provide typed constants in preference to #define where legal and appropriate to do so. |
12.3#7
|
 |
Use functions in preference to function-like macros unless performance is a genuine issue. |
12.3#8
|
 |
Defining a macro called defined or attempting to #undef it, is forbidden. |
12.3#9
|
 |
Attempting to #define or #undef any of __LINE__, __FILE__, __DATE__, __TIME__, or __STDC__ is forbidden. |
12.3#10
|
 |
A function-like macro must be supplied with its expected arguments. |
12.3#11
|
 |
Macro arguments must not contain a sequence of tokens which look like a preprocessor directive. |
12.3.1#1
|
 |
A macro shall not comprise both the "#" and "##" operators simultaneously. |
12.3.2#1
|
 |
The result of the "##" operator shall be a legal pre-processing token. |
12.4#1
|
 |
The #include directive must only be followed by a <...> or a "..." file sequence. |
12.4#2
|
 |
Use of the ' " \ or /* characters in the #include file sequence <...> or "...", is forbidden. |
12.5#1
|
 |
The defined macro must appear in the form 'defined(identifier)' or 'defined identifier'. |
12.6#1
|
 |
The #line directive shall specify a line number in the range 1 to 32767. |
12.8#1
|
 |
The #pragma directive shall not be used without sign-off according to local quality procedures. |
12.9#1
|
 |
The null preprocessor directive # should not be used. |
C#2
|
 |
The #error directive should be used with caution. |