[v3,3/5] cdefs.h: Enable __errordecl & __warnattr for Clang 14+
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
Commit Message
Clang 14 (released in March 2022) has added support for
attribute ((error)) and attribute ((warning)). Enable their usage when
Clang 14 or later is detected, to get nicer diagnostics.
https://reviews.llvm.org/D106030
https://github.com/llvm/llvm-project/commit/846e562dcc6a9a611d844dc0d123da95629a0567
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
misc/sys/cdefs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -208,7 +208,7 @@
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
#endif
-#if __GNUC_PREREQ (4,3)
+#if __GNUC_PREREQ (4,3) || __glibc_clang_prereq (14,0)
# define __warnattr(msg) __attribute__((__warning__ (msg)))
# define __errordecl(name, msg) \
extern void name (void) __attribute__((__error__ (msg)))