|
30 | 30 | # define __GCC4_has_attribute___assume_aligned__ 1 |
31 | 31 | # define __GCC4_has_attribute___copy__ 0 |
32 | 32 | # define __GCC4_has_attribute___designated_init__ 0 |
| 33 | +# define __GCC4_has_attribute___error__ 1 |
33 | 34 | # define __GCC4_has_attribute___externally_visible__ 1 |
34 | 35 | # define __GCC4_has_attribute___no_caller_saved_registers__ 0 |
35 | 36 | # define __GCC4_has_attribute___noclone__ 1 |
36 | 37 | # define __GCC4_has_attribute___no_profile_instrument_function__ 0 |
37 | 38 | # define __GCC4_has_attribute___nonstring__ 0 |
38 | 39 | # define __GCC4_has_attribute___no_sanitize_address__ 1 |
39 | 40 | # define __GCC4_has_attribute___no_sanitize_undefined__ 1 |
| 41 | +# define __GCC4_has_attribute___no_sanitize_coverage__ 0 |
40 | 42 | # define __GCC4_has_attribute___fallthrough__ 0 |
| 43 | +# define __GCC4_has_attribute___warning__ 1 |
41 | 44 | #endif |
42 | 45 |
|
43 | 46 | /* |
|
137 | 140 | # define __designated_init |
138 | 141 | #endif |
139 | 142 |
|
| 143 | +/* |
| 144 | + * Optional: only supported since clang >= 14.0 |
| 145 | + * |
| 146 | + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute |
| 147 | + */ |
| 148 | +#if __has_attribute(__error__) |
| 149 | +# define __compiletime_error(msg) __attribute__((__error__(msg))) |
| 150 | +#else |
| 151 | +# define __compiletime_error(msg) |
| 152 | +#endif |
| 153 | + |
140 | 154 | /* |
141 | 155 | * Optional: not supported by clang |
142 | 156 | * |
|
298 | 312 | */ |
299 | 313 | #define __must_check __attribute__((__warn_unused_result__)) |
300 | 314 |
|
| 315 | +/* |
| 316 | + * Optional: only supported since clang >= 14.0 |
| 317 | + * |
| 318 | + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute |
| 319 | + */ |
| 320 | +#if __has_attribute(__warning__) |
| 321 | +# define __compiletime_warning(msg) __attribute__((__warning__(msg))) |
| 322 | +#else |
| 323 | +# define __compiletime_warning(msg) |
| 324 | +#endif |
| 325 | + |
301 | 326 | /* |
302 | 327 | * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute |
303 | 328 | * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute |
|
0 commit comments