Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
19.13 and Assembly
#4
The presence of a parenthesised, possibly empty, parameter list in the definition of a macro makes it a function-like macro. See the C90 standard, Section 6.8.3.

This means that all of:
Code:
#define QWER(x) { asm x ASDF #$7F; }
#define QWER(x) { asm ASDF #$7F; }
#define QWER() { asm ASDF #$7F; }
are function-like macros and therefore contain instances of the # preprocessing operator.

The # preprocessing operator must be followed by a parameter (constraint C90 Section 6.8.3.2). Therefore none of the above examples is legal C.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)