diff options
| author | jvoisin | 2025-11-14 15:06:23 +0100 |
|---|---|---|
| committer | jvoisin | 2025-11-14 16:56:09 +0100 |
| commit | e9b6cb7e2eb7029902ae92ef43fb905e5072785b (patch) | |
| tree | 81a2faba510f23858c8fba80c2345227be4e8e3b /include/fortify-headers.h | |
| parent | bf242b15e1f7873bdb940c2441b5e57747bc2f81 (diff) | |
Add `format` annotations
Diffstat (limited to '')
| -rw-r--r-- | include/fortify-headers.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h index a9b7498..67c4792 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h | |||
| @@ -59,15 +59,20 @@ | |||
| 59 | #define __bos(ptr, type) __builtin_object_size (ptr, type) | 59 | #define __bos(ptr, type) __builtin_object_size (ptr, type) |
| 60 | #endif | 60 | #endif |
| 61 | 61 | ||
| 62 | /* This needs to be two different conditions: https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html */ | ||
| 63 | #if defined __has_attribute | 62 | #if defined __has_attribute |
| 63 | |||
| 64 | #if __has_attribute (access) | 64 | #if __has_attribute (access) |
| 65 | #define __access(...) __attribute__ ((access (__VA_ARGS__))) | 65 | #define __access(...) __attribute__ ((access (__VA_ARGS__))) |
| 66 | #else | 66 | #else |
| 67 | #define __access(...) | 67 | #define __access(...) |
| 68 | #endif | 68 | #endif |
| 69 | |||
| 70 | #if __has_attribute (format) | ||
| 71 | #define __format(...) __attribute__ ((format (__VA_ARGS__))) | ||
| 69 | #else | 72 | #else |
| 70 | #define __access(...) | 73 | #define __format(...) |
| 74 | #endif | ||
| 75 | |||
| 71 | #endif | 76 | #endif |
| 72 | 77 | ||
| 73 | #endif | 78 | #endif |
