https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102329
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> --- In general a program can add an attribute to a system function by redeclaring it with it. This of course needs to be done conditionally on the GCC version that supports the attribute. This in turn can be tested at compile time by the __has_attribute operator or based on GCC version macros.