Rule 8.8 clarification - 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.8 Declarations and defnitions (https://forum.misra.org.uk/forumdisplay.php?fid=163) +---- Thread: Rule 8.8 clarification (/showthread.php?tid=1144) |
Rule 8.8 clarification - anuj1085 - 10-02-2015 Just wanted to clarify the rule, i understand this is non-compliance: ========================================================== static void xyz(); void xyz() /*Non_compliant */ { ........... } ========================================================== But the i have query regarding the following: ========================================================== void xyz(); static void xyz() /* Is this non-compliance*/ { ............... } ========================================================== So in the above case where first the function is declared as extern(by default), would it be non complaint under this rule to define it static? Re: Rule 8.8 clarification - misra-c - 13-02-2015 Code: static void xyz(); Both declarations therefore have internal linkage. This is well-defined in C, but violates rule 8.8. Code: void xyz(); |