MISRA Discussion Forums
Is 16.4 violated if 16.3 is? - 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: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17)
+---- Forum: 6.16 Functions (https://forum.misra.org.uk/forumdisplay.php?fid=47)
+---- Thread: Is 16.4 violated if 16.3 is? (/showthread.php?tid=918)



Is 16.4 violated if 16.3 is? - gs - 11-10-2012

Given the following code:
Code:
void f(int);
void f(int x){}
Does this code violate rule #16.4, identifiers used in the declaration and definition of a function shall be identical? While the lack of a parameter name in the prototype violates #16.3, I am not sure if violating #16.4 is possible in that case.


Re: Is 16.4 violated if 16.3 is? - misra-c - 16-10-2012

No is doesn't really make sense to flag a violation of both rules in this case. Therefore, to violate Rule 16.4, both identifiers need to be present, but different.