Synopsis: | Result of "##" operator shall be a legal pre-processing token. |
Language: | C |
Severity Level: | 2 |
Category: | Preprocessing Directives |
Description: |
Justification The "##" operator should be used sparingly and with care. In particular there are constraints which operate on the context in which it may be used. The result of the glue operator should be a valid pre-processing token; so it is not legal, for instance, to glue together an operator to an identifier. Valid pre-processing tokens must have the lexical form of a header-name, an identifier, a character constant, a string literal, an operator, a punctuator or any non-white-space character that cannot be one of the above. Example 1 #define Select(a) (xxx_struct.##a) /* WRONG: The "." is a separate token */ Example 2 #define Select(a) (xxx_struct.a) /* RIGHT */ |