Rule 5.4: Macro identifier - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21) +---- Forum: 8.5 Identifers (https://forum.misra.org.uk/forumdisplay.php?fid=160) +---- Thread: Rule 5.4: Macro identifier (/showthread.php?tid=1187) |
Rule 5.4: Macro identifier - Polyspacer - 16-06-2015 I have a question regarding rule 5.4: Which of the following #defines is violating this rule? Code: #define engine_exhaust_gas_temperature_high_raw egt_r The 1st and 2nd #define are similar to the example given in the MISRA-C guideline. Hence, the 2nd #define violates the rule. The 3rd and 4th #define are identical. Therefore, the 4th #define violates the rule. The 5th and 6th #define are identical as well. Does the 6th #define violate the rule? According to the glossary, the macro name is a macro identifier... Re: Rule 5.4: Macro identifier - misra-c - 25-06-2015 The amplification states Quote: This rule requires that, when a macro is being defined, its name be distinct from:Therefore there will only be a violation of Rule 5.4 on DAI_AGK_SEC_1BIT_RAM_START if both ABCDE and FGHIJ are not defined. |