Compiler Attributes improvements:
- Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 (Marco Elver) - Add Nick as Reviewer for compiler_attributes.h (Nick Desaulniers) - Move __compiletime_{error|warning} (Nick Desaulniers) -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEPjU5OPd5QIZ9jqqOGXyLc2htIW0FAmE7oSQACgkQGXyLc2ht IW3rqRAAvf8hfzkqHY7F9LQRE2JMdRb5pyg0Qyk6vl3YKq3KF0vTAtZ+LVx6svAu 2MQBPxLGtYtQeeO6BVxsIyFZOG8zSh4EZ2QBBpTB0nnz8Y/Sfwxs6NVi1tOJ0Jsn Y8f8uX2U7U2Jjmi75HJIKXKLvoldO5OYlY8CaBKbRWdxVef4B2075eHhTJzHGeJx eWbJ289j3/W2Q+lRIAK+XBku3UJ8Yhj+oiEA/eLNeegpbeHIaW1QIb7Tw/b0ZndC HUM+24rY63ZNHBAuGA9Cap2eeb8YQ+FKq6OoOZBqtX7/OI54jia++1cqLDvkZO/Z xnkXfNWJCGYttQp8DCgPcy6en81QDGQ7z9WOsfde2UVH1YtjKSbeloFu0/bk4olU 2ebsnmmai81d31uRYAQDfiTGdhPhNa2zE3cj8Rp3kCDIGALt9uV1Rz6wPMyRwySH mfoSWywnTR+If4Czstl7JOpeXHU2BWC7x9vgHTGSRW60TvG0zxscBmJFJYyM5HWO gj+LHHb2R9R0aAw+3jvE+Ta/lOXRlNxtrOcojM27p2VRll3vMc+5uEj37N18qWpE GFHxKBwAvstFC1Gt4jpQBpHt5A8C+QG0EE2ZUQcNptlCe3XuUBav/heCJBFLENwm /3ApWbmBDZc7O3hJy2qH9LT6f6CtgyB0SnvMnWQE3x/Ji2SHby8= =FOgy -----END PGP SIGNATURE----- Merge tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux Pull compiler attributes updates from Miguel Ojeda: - Fix __has_attribute(__no_sanitize_coverage__) for GCC 4 (Marco Elver) - Add Nick as Reviewer for compiler_attributes.h (Nick Desaulniers) - Move __compiletime_{error|warning} (Nick Desaulniers) * tag 'compiler-attributes-for-linus-v5.15-rc1-v2' of git://github.com/ojeda/linux: compiler_attributes.h: move __compiletime_{error|warning} MAINTAINERS: add Nick as Reviewer for compiler_attributes.h Compiler Attributes: fix __has_attribute(__no_sanitize_coverage__) for GCC 4
This commit is contained in:
commit
c3e46874df
@ -4684,6 +4684,7 @@ F: drivers/platform/x86/compal-laptop.c
|
||||
|
||||
COMPILER ATTRIBUTES
|
||||
M: Miguel Ojeda <ojeda@kernel.org>
|
||||
R: Nick Desaulniers <ndesaulniers@google.com>
|
||||
S: Maintained
|
||||
F: include/linux/compiler_attributes.h
|
||||
|
||||
|
@ -43,9 +43,6 @@
|
||||
|
||||
#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
|
||||
|
||||
#define __compiletime_warning(message) __attribute__((__warning__(message)))
|
||||
#define __compiletime_error(message) __attribute__((__error__(message)))
|
||||
|
||||
#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
|
||||
#define __latent_entropy __attribute__((latent_entropy))
|
||||
#endif
|
||||
|
@ -30,6 +30,7 @@
|
||||
# define __GCC4_has_attribute___assume_aligned__ 1
|
||||
# define __GCC4_has_attribute___copy__ 0
|
||||
# define __GCC4_has_attribute___designated_init__ 0
|
||||
# define __GCC4_has_attribute___error__ 1
|
||||
# define __GCC4_has_attribute___externally_visible__ 1
|
||||
# define __GCC4_has_attribute___no_caller_saved_registers__ 0
|
||||
# define __GCC4_has_attribute___noclone__ 1
|
||||
@ -37,7 +38,9 @@
|
||||
# define __GCC4_has_attribute___nonstring__ 0
|
||||
# define __GCC4_has_attribute___no_sanitize_address__ 1
|
||||
# define __GCC4_has_attribute___no_sanitize_undefined__ 1
|
||||
# define __GCC4_has_attribute___no_sanitize_coverage__ 0
|
||||
# define __GCC4_has_attribute___fallthrough__ 0
|
||||
# define __GCC4_has_attribute___warning__ 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -137,6 +140,17 @@
|
||||
# define __designated_init
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Optional: only supported since clang >= 14.0
|
||||
*
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute
|
||||
*/
|
||||
#if __has_attribute(__error__)
|
||||
# define __compiletime_error(msg) __attribute__((__error__(msg)))
|
||||
#else
|
||||
# define __compiletime_error(msg)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Optional: not supported by clang
|
||||
*
|
||||
@ -298,6 +312,17 @@
|
||||
*/
|
||||
#define __must_check __attribute__((__warn_unused_result__))
|
||||
|
||||
/*
|
||||
* Optional: only supported since clang >= 14.0
|
||||
*
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute
|
||||
*/
|
||||
#if __has_attribute(__warning__)
|
||||
# define __compiletime_warning(msg) __attribute__((__warning__(msg)))
|
||||
#else
|
||||
# define __compiletime_warning(msg)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute
|
||||
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute
|
||||
|
@ -294,12 +294,6 @@ struct ftrace_likely_data {
|
||||
#ifndef __compiletime_object_size
|
||||
# define __compiletime_object_size(obj) -1
|
||||
#endif
|
||||
#ifndef __compiletime_warning
|
||||
# define __compiletime_warning(message)
|
||||
#endif
|
||||
#ifndef __compiletime_error
|
||||
# define __compiletime_error(message)
|
||||
#endif
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
# define __compiletime_assert(condition, msg, prefix, suffix) \
|
||||
|
Loading…
Reference in New Issue
Block a user