Loading...
Searching...
No Matches
Go to the documentation of this file.
2#ifndef __LINUX_COMPILER_ATTRIBUTES_H
3#define __LINUX_COMPILER_ATTRIBUTES_H
26#define __alias(symbol) __attribute__((__alias__(#symbol)))
33#define __aligned(x) __attribute__((__aligned__(x)))
34#define __aligned_largest __attribute__((__aligned__))
44#define __alloc_size__(x, ...) __attribute__((__alloc_size__(x, ## __VA_ARGS__)))
55#define __always_inline inline __attribute__((__always_inline__))
70#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
76#define __cleanup(func) __attribute__((__cleanup__(func)))
83#define __attribute_const__ __attribute__((__const__))
91#if __has_attribute(__copy__)
92# define __copy(symbol) __attribute__((__copy__(symbol)))
94# define __copy(symbol)
103#if __has_attribute(__diagnose_as_builtin__)
104# define __diagnose_as(builtin...) __attribute__((__diagnose_as_builtin__(builtin)))
106# define __diagnose_as(builtin...)
126#if __has_attribute(__designated_init__)
127# define __designated_init __attribute__((__designated_init__))
129# define __designated_init
137#if __has_attribute(__error__)
138# define __compiletime_error(msg) __attribute__((__error__(msg)))
140# define __compiletime_error(msg)
148#if __has_attribute(__externally_visible__)
149# define __visible __attribute__((__externally_visible__))
158#define __printf(a, b) __attribute__((__format__(printf, a, b)))
159#define __scanf(a, b) __attribute__((__format__(scanf, a, b)))
165#define __gnu_inline __attribute__((__gnu_inline__))
171#define __malloc __attribute__((__malloc__))
177#define __mode(x) __attribute__((__mode__(x)))
185#if __has_attribute(__no_caller_saved_registers__)
186# define __no_caller_saved_registers __attribute__((__no_caller_saved_registers__))
188# define __no_caller_saved_registers
196#if __has_attribute(__noclone__)
197# define __noclone __attribute__((__noclone__))
213#if __has_attribute(__fallthrough__)
214# define fallthrough __attribute__((__fallthrough__))
216# define fallthrough do {} while (0)
223# define __flatten __attribute__((flatten))
231#define noinline __attribute__((__noinline__))
240#define __nonnull_args(x...) __attribute__((__nonnull__(x)))
248#if __has_attribute(__nonstring__)
249# define __nonstring __attribute__((__nonstring__))
260#if __has_attribute(__no_profile_instrument_function__)
261# define __no_profile __attribute__((__no_profile_instrument_function__))
271#define __noreturn __attribute__((__noreturn__))
279#if __has_attribute(__no_stack_protector__)
280# define __no_stack_protector __attribute__((__no_stack_protector__))
282# define __no_stack_protector
290#if __has_attribute(__overloadable__)
291# define __overloadable __attribute__((__overloadable__))
293# define __overloadable
300#define __packed __attribute__((__packed__))
309#if __has_attribute(__pass_dynamic_object_size__)
310# define __pass_dynamic_object_size(type) __attribute__((__pass_dynamic_object_size__(type)))
312# define __pass_dynamic_object_size(type)
314#if __has_attribute(__pass_object_size__)
315# define __pass_object_size(type) __attribute__((__pass_object_size__(type)))
317# define __pass_object_size(type)
323#define __pure __attribute__((__pure__))
330#define __section(section) __attribute__((__section__(section)))
338#if __has_attribute(__uninitialized__)
339# define __uninitialized __attribute__((__uninitialized__))
341# define __uninitialized
351#define __always_unused __attribute__((__unused__))
352#define __maybe_unused __attribute__((__unused__))
358#define __used __attribute__((__used__))
371#define __always_used __used __maybe_unused
377#define __must_check __attribute__((__warn_unused_result__))
384#if __has_attribute(__warning__)
385# define __compiletime_warning(msg) __attribute__((__warning__(msg)))
387# define __compiletime_warning(msg)
401#if __has_attribute(disable_sanitizer_instrumentation)
402# define __disable_sanitizer_instrumentation \
403 __attribute__((disable_sanitizer_instrumentation))
405# define __disable_sanitizer_instrumentation
413#if __has_attribute(noipa)
414# define __noipa __attribute__((noipa))
423#define __weak __attribute__((__weak__))
430#define __fix_address noinline __noclone