Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
19.7 no function-like macros
#2
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
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)