rspec/rules/S926/rule.adoc
2020-06-30 17:16:12 +02:00

23 lines
520 B
Plaintext

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.
== Noncompliant Code Example
----
void divide (int, int);
----
== Compliant Solution
----
void divide (int numerator, int denominator);
----
== 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