Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 19.12 (# and ## operator) real issue?
#4
If the macro

Code:
#define m (a,b) a##3##b

is invoked as

Code:
m ( PRE, SUF ) = 0;

then the order of evaluation is important. The result of the ## operator
must be a valid preprocessing token.

Left-to-right evaluation gives 'PRE3' followed by 'PRE3SUF'.

However, the first expansion from right-to-left evaluation is 3SUF, which is
not a valid preprocessing token.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)