From bf242b15e1f7873bdb940c2441b5e57747bc2f81 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 12 Nov 2025 22:28:13 +0100 Subject: Add `access` annotations --- include/fortify-headers.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/fortify-headers.h') diff --git a/include/fortify-headers.h b/include/fortify-headers.h index e406dce..a9b7498 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -59,4 +59,15 @@ #define __bos(ptr, type) __builtin_object_size (ptr, type) #endif +/* This needs to be two different conditions: https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html */ +#if defined __has_attribute +#if __has_attribute (access) +#define __access(...) __attribute__ ((access (__VA_ARGS__))) +#else +#define __access(...) +#endif +#else +#define __access(...) +#endif + #endif -- cgit v1.3