diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2023-06-30 18:41:39 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-06-30 18:41:39 +0300 |
commit | 44f10dbefd5e41b3385af91f855a57aa2afaf40e (patch) | |
tree | 944c9f1cda8322691468e6f10dc5b0d41c487621 /include/linux/compiler_attributes.h | |
parent | 0a30901b0732a59e038088d3de3e5611db1870d3 (diff) | |
parent | e55e5df193d247a38a5e1ac65a5316a0adcc22fa (diff) | |
download | linux-44f10dbefd5e41b3385af91f855a57aa2afaf40e.tar.xz |
Merge branch 'master' into mm-hotfixes-stable
Diffstat (limited to 'include/linux/compiler_attributes.h')
-rw-r--r-- | include/linux/compiler_attributes.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h index e659cb6fded3..571fa7924f74 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h @@ -124,6 +124,19 @@ #endif /* + * Optional: only supported since gcc >= 14 + * Optional: only supported since clang >= 17 + * + * gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896 + * clang: https://reviews.llvm.org/D148381 + */ +#if __has_attribute(__element_count__) +# define __counted_by(member) __attribute__((__element_count__(#member))) +#else +# define __counted_by(member) +#endif + +/* * Optional: only supported since clang >= 14.0 * * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute @@ -256,6 +269,18 @@ #define __noreturn __attribute__((__noreturn__)) /* + * Optional: only supported since GCC >= 11.1, clang >= 7.0. + * + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute + * clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers + */ +#if __has_attribute(__no_stack_protector__) +# define __no_stack_protector __attribute__((__no_stack_protector__)) +#else +# define __no_stack_protector +#endif + +/* * Optional: not supported by gcc. * * clang: https://clang.llvm.org/docs/AttributeReference.html#overloadable |