MISRA Discussion Forums

Full Version: Rule 2.5 and unused macro parameter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Rule 2.5 states "A project should not contain unused macro declaration".

Forum post https://www.misra.org.uk/forum/viewtopic...216&t=1571 acknowledges that Rule 2.5 should be "A project should not contain unused macro definition", however a change to "A project should not contain unused macro identifier" would cover both the original intent and also catch the following coding error without compromising rule decidability:
[code]
/* Macro containing coding error - macro parameter pin is unused */
#define SET_PIN(pin, polarity) \
((GPIO->PIN[pin_number] & ~PIN_Msk) | (polarity
Thank you for your comment on rule 2.5. The MISRA-C working group will consider it for future versions.