27-04-2006, 09:24 AM
ISO defines a function-like macro to be a macro with a parenthesised argument list (which may be empty.)
For example, these are function-like macros
#define abs(x) (((x) >= 0) ? (x) : -(x))
#define pi() 3.14159265
MISRA-C Committee 27.4.2006
For example, these are function-like macros
#define abs(x) (((x) >= 0) ? (x) : -(x))
#define pi() 3.14159265
MISRA-C Committee 27.4.2006
Posted by and on behalf of the MISRA C Working Group