== Why is this an issue?

While it is technically correct to assign to parameters from within function bodies, it is better to use temporary variables to store intermediate results.

Allowing parameters to be assigned to also reduces the code readability as developers will not be able to know whether the original parameter or some temporary variable is being accessed without going through the whole function.

=== Noncompliant code example

[source,cpp]
----
int glob = 0;
void function (int a) {
  a = glob; // Noncompliant
  ...
}
----

=== Compliant solution

[source,cpp]
----
int glob = 0;
void function (int a) {
  int b = glob;
  ...
}
----

== Resources

* MISRA C:2012, 17.8 - A function parameter should not be modified

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
