02-05-2019, 08:39 AM
The MISRA C:2012 guidelines uses the definition as the C99 standard. ( see section 3.14 and 6.2.1 ). Regarding your specific examples:
Most of the MISRA C:2012 guidelines, including rule 8.9 apply after macro expansion.
For example:
Code:
* Variable // object
* Const-qualified variable // object
* Function // not an object
* Object-like macro // not an object, but may expand to an object
* Function-like macro // not an object, but may expand to an object
For example:
Code:
int x; // object
int fn(int y); // function
#define MYMAC(Z) Z
int MYMAC(r) = 3; // expands to int r = 3; which is an object definition
MYMAC(fn)(x); // expands to fn(x); which is a function call
Posted by and on behalf of the MISRA C Working Group