Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Definition of "object"
#7
The MISRA C:2012 guidelines uses the definition as the C99 standard. ( see section 3.14 and 6.2.1 ). Regarding your specific examples:
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
Most of the MISRA C:2012 guidelines, including rule 8.9 apply after macro expansion.
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)