MISRA Discussion Forums

Full Version: Rule 2-10-5 and function overloading
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

does rule 2-10-5 disallows function overloading? What is the definition of "identifier reuse"?
For example:
Code:
class C{};
void foo(int);
void foo(C);      // Not compliant?
void foo(int, C); // Not compliant?
Hello,

Did you get any answer to this?
Does anybody have an opinion on 2-10-5 and function overloading?

thank you.
The short answer is No, this rule does not prohibit function overloading. The intent was to prohibit the reuse of identifiers for unrelated objects.

This will be clarified in a Technical Corrigendum