fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit a45c2e741913ffb5a4ffbddf44cbc26091fe3b41
parent c08370434fe1c1cdc0963cf2317583676bb1799b
Author: q66 <q66@chimera-linux.org>
Date:   Fri, 15 Dec 2023 22:42:34 +0100

Do not use static inline for C++ to avoid ODR violations

Fixes https://github.com/jvoisin/fortify-headers/issues/31

Diffstat:
Minclude/fortify-headers.h | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/fortify-headers.h b/include/fortify-headers.h @@ -27,8 +27,13 @@ #endif /* we can't use extern inline with overloads without making them external */ +#ifdef __cplusplus +#define _FORTIFY_INLINE __inline__ \ + __attribute__((__always_inline__,__artificial__,__overloadable__)) +#else #define _FORTIFY_INLINE static __inline__ \ __attribute__((__always_inline__,__artificial__,__overloadable__)) +#endif #else /* !__clang__ */