From c29287d01bceb0a54996be1e138f2e7f62917907 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 20 Aug 2023 20:28:13 +0200 Subject: Make use of pass_dynamic_object_size when available --- include/fortify-headers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/fortify-headers.h b/include/fortify-headers.h index 18d302b..a918b10 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -25,7 +25,11 @@ #ifdef __clang__ /* clang uses overloads; see https://github.com/llvm/llvm-project/issues/53516 */ +#if __has_attribute(pass_dynamic_object_size) +#define _FORTIFY_POSN(n) const __attribute__((pass_dynamic_object_size(n))) +#else #define _FORTIFY_POSN(n) const __attribute__((pass_object_size(n))) +#endif /* pass_dynamic_object_size) */ /* we can't use extern inline with overloads without making them external */ #define _FORTIFY_INLINE static __inline__ \ __attribute__((__always_inline__,__artificial__,__overloadable__)) -- cgit v1.3