Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.9 and macros
#1
I believe that a macro has no linkage and is not an object and therefore is not covered by rule 8.9 (or indeed rule 8.4)

My problem is that C allows for multiple definitions of the same macro provided that the definitions are identical:

#define BILL some text
.
.
.
#define BILL some text

As far as I can tell, the above is legal C code and appears to not violate any MISRA rule. This is obviously undesirable!

Is my understanding correct or is there a MISRA rule to forbid such code?

Thanks,
Bill Forbes.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)