2021-04-28 16:49:39 +02:00
Naming the parameters in a function prototype helps identify how they'll be used by the function, thereby acting as a thin layer of documentation for the function.
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
void divide (int, int);
----
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
void divide (int numerator, int denominator);
----
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== See
* MISRA C:2004, 16.3 - Identifiers shall be given for all of the parameters in a function prototype declaration
* MISRA C:2012, 8.2 - Function types shall be in prototype form with named parameters
2021-04-28 18:08:03 +02:00