28-02-2025, 01:04 PM
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.
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
the MISRA C++ Working Group