diff options
| author | jvoisin | 2023-08-21 17:22:28 +0200 |
|---|---|---|
| committer | jvoisin | 2023-08-21 17:22:28 +0200 |
| commit | e8b8e4f51481121a5ce042812e7e62e7b27e6116 (patch) | |
| tree | 553bbc25810358bbca3b90da6543f1061132ed9c /include/fortify-headers.h | |
| parent | 254471b1c96c2ab34a043350519aea37a0862b9b (diff) | |
Make use of __diagnose_if
Diffstat (limited to 'include/fortify-headers.h')
| -rw-r--r-- | include/fortify-headers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h index 88a0875..3e2140f 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h | |||
| @@ -99,6 +99,14 @@ | |||
| 99 | #define __diagnose_as_builtin(...) | 99 | #define __diagnose_as_builtin(...) |
| 100 | #endif | 100 | #endif |
| 101 | 101 | ||
| 102 | #if __has_attribute (__diagnose_if) | ||
| 103 | #define __warning_if(cond, msg) __attribute__ ((__diagnose_if (cond, msg, "warning"))) | ||
| 104 | #define __error_if(cond, msg) __attribute__ ((__diagnose_if (cond, msg, "error"))) | ||
| 105 | #else | ||
| 106 | #define __warning_if(cond, msg) | ||
| 107 | #define __error_if(cond, msg) | ||
| 108 | #endif | ||
| 109 | |||
| 102 | #endif /* __has_attribute */ | 110 | #endif /* __has_attribute */ |
| 103 | 111 | ||
| 104 | /* | 112 | /* |
