From 611069d07c14bf7ace7a75fa2bc9147db8ac097d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 14 Nov 2025 16:25:52 +0100 Subject: Add __diagnose_if 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 67c4792..1581076 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h @@ -73,6 +73,12 @@ #define __format(...) #endif +#if __has_attribute (__diagnose_if) +#define __warning_if(cond, msg) __attribute__ ((__diagnose_if (cond, msg, "warning"))) +#else +#define __warning_if(cond, msg) +#endif + #endif #endif -- cgit v1.3