From b333df29dcfabcd4ad0cf630fdb648eaa38ec1c7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 9 Jul 2023 18:50:30 +0200 Subject: Add some `format` annotations --- include/fortify-headers.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/fortify-headers.h') diff --git a/include/fortify-headers.h b/include/fortify-headers.h index 08b8dd3..24af881 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -60,6 +60,12 @@ #define __access(...) #endif +#if defined __has_attribute && __has_attribute (format) +#define __format(...) __attribute__ ((format (__VA_ARGS__))) +#else +#define __format(...) +#endif + /* TODO(jvoisin) Figure a nice way to make use of __builtin_mul_overflow while ignoring the result. */ /* TODO(jvoisin) Make use of C23's stdckdint header: https://gustedt.gitlabpages.inria.fr/c23-library/#stdckdint */ -- cgit v1.3