aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-12-05 15:47:16 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-09 10:29:17 -0300
commitcdb449e70c3f810d5e9aa8ce4f937bd4a313c5cf (patch)
tree75f640da098c517914c4e8f23af0aa293a8d5544 /misc
parentf7fc094c1c3657bfe410c5185fa5ac47e203efcd (diff)
downloadglibc-cdb449e70c3f810d5e9aa8ce4f937bd4a313c5cf.tar
glibc-cdb449e70c3f810d5e9aa8ce4f937bd4a313c5cf.tar.gz
glibc-cdb449e70c3f810d5e9aa8ce4f937bd4a313c5cf.tar.bz2
glibc-cdb449e70c3f810d5e9aa8ce4f937bd4a313c5cf.zip
debug: Improve fcntl.h fortify warnings with clang
It improves open, open64, openat, and openat64. The compile and runtime checks have similar coverage as with GCC. Checked on aarch64, armhf, x86_64, and i686.
Diffstat (limited to 'misc')
-rw-r--r--misc/sys/cdefs.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 62507044c8..6b03417453 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -257,7 +257,9 @@
# define __fortify_clang_warning(__c, __msg) \
__attribute__ ((__diagnose_if__ ((__c), (__msg), "warning")))
-# define __fortify_clang_warning_only_if_bos0_lt(n, buf, complaint) \
+# define __fortify_clang_error(__c, __msg) \
+ __attribute__ ((__diagnose_if__ ((__c), (__msg), "error")))
+# define __fortify_clang_warning_only_if_bos0_lt(n, buf, complaint) \
__attribute__ ((__diagnose_if__ \
(__fortify_clang_bosn_args (__bos0, n, buf, 1, complaint))))
# define __fortify_clang_warning_only_if_bos0_lt2(n, buf, div, complaint) \
@@ -270,6 +272,11 @@
__attribute__ ((__diagnose_if__ \
(__fortify_clang_bosn_args (__bos, n, buf, div, complaint))))
+# define __fortify_clang_prefer_this_overload \
+ __attribute__ ((enable_if (1, "")))
+# define __fortify_clang_unavailable(__msg) \
+ __attribute__ ((unavailable(__msg)))
+
# if __USE_FORTIFY_LEVEL == 3
# define __fortify_clang_overload_arg(__type, __attr, __name) \
__type __attr const __fortify_clang_pass_dynamic_object_size __name