02-04-2008, 07:12 AM
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.
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.