Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 6.2.1 weak linkage
#2
We don't believe that __attribute__((weak)) is defined in  C++17, so any use must be part of a language extension, which is out of the scope of MISRA C++

However, if you are using such an extension and you are getting violation messages from your tools, then the expected behaviour of weak vs. strong attributes is a justification to deviate.

As far as "replaceable" functions are concerned, the standard explicitly permits you to replace these functions with a user supplied version. This is not considered an ODR violation.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
Rule 6.2.1 weak linkage - by hahn - 28-02-2025, 09:33 AM
RE: Rule 6.2.1 weak linkage - by misra cpp - 28-02-2025, 01:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)