Synopsis: | Use functions in preference to function-like macros unless performance is a genuine issue. |
Language: | C |
Severity Level: | 5 |
Category: | PREPROCESSING |
Description: |
The function-like macro #define PLUS(x,y) x + y could better be defined as int plus(int x, int y) { return x + y; } The main reason for this is that the code in the latter case is properly type-checked by the compiler. |