mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-09 00:59:55 +00:00
Recent compilers support __has_attribute() to check if a certain
compiler attribute is supported.
Unfortunately we have to first check if __has_attribute is supported in
the first place and then if a specific attribute is present.
These two checks can't be folded into a single condition as that would
lead to errors.
Nesting the two conditions like below works, but becomes ugly as soon
as #else blocks are used as those need to be duplicated for both levels
of #if.
#if defined __has_attribute
# if __has_attribute (nonnull)
# define ATTR_NONNULL __attribute__ ((nonnull))
# endif
#endif
Introduce a new helper which makes the usage of __has_attribute() nicer
and migrate the current user to it.
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-4-c20f2f5fc7c2@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| arch-aarch64.h | ||
| arch-arm.h | ||
| arch-i386.h | ||
| arch-loongarch.h | ||
| arch-mips.h | ||
| arch-powerpc.h | ||
| arch-riscv.h | ||
| arch-s390.h | ||
| arch-x86_64.h | ||
| arch.h | ||
| compiler.h | ||
| crt.h | ||
| ctype.h | ||
| errno.h | ||
| Makefile | ||
| nolibc.h | ||
| signal.h | ||
| stackprotector.h | ||
| std.h | ||
| stdarg.h | ||
| stdbool.h | ||
| stdint.h | ||
| stdio.h | ||
| stdlib.h | ||
| string.h | ||
| sys.h | ||
| time.h | ||
| types.h | ||
| unistd.h | ||