Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does rule A2-10-5 apply to reusing an external identifier as a member identifier?
#4
The basic problem with A2-10-5 is that it implies that functions can have static storage duration, this is incorrect.

We think what was intended was that the name of functions with internal linkage should not be reused anywhere in the program, this includes both functions declared with the static keyword and those declared in an anonymous namespace (as of C++ 2011).
All the functions in your example have external linkage, so the rule does not apply, so your code is compliant.

As far as object declarations are concerned, the Autosar rule text is unambiguous and the rule applies to non-member objects with internal or external linkage.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: Does rule A2-10-5 apply to reusing an external identifier as a member identifier? - by misra cpp - 17-07-2026, 01:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)