Synopsis: | Use of macros shall strictly be according to the ANSI C89 macro syntax and within the ANSI C89 macro constraints. |
Language: | C |
Severity Level: | 2 |
Category: | Preprocessing Directives |
Description: |
Justification Use of macros other than within the strict ANSI C89 syntax and constraints may be acceptable for a certain pre-processor but delivers an undefined or at least non-portable source to the compiler's translation phase. Example #define PLAK(a ,b) a ## b /* ... */ #define PLAK (1) /* WRONG: redefines PLAK */ #define STR(text) #text /* ... */ char *msg = STR(error, "\n"); /* WRONG: too many arguments */ |