summaryrefslogtreecommitdiffstats
path: root/sys/sys/cdefs.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-04-22 18:13:28 +0000
committerpfg <pfg@FreeBSD.org>2015-04-22 18:13:28 +0000
commitf527cebd543a96f31fea3c1ad924a269fde3a273 (patch)
treee17db023a2975354aa283c9b66f8f04929b2b95e /sys/sys/cdefs.h
parent90d0d1c5a567c8cc6751443c046b50fa722d88a5 (diff)
downloadFreeBSD-src-f527cebd543a96f31fea3c1ad924a269fde3a273.zip
FreeBSD-src-f527cebd543a96f31fea3c1ad924a269fde3a273.tar.gz
Add definition for the argument_with_type_tag attribute.
This attribute originates in clang and brings support for checking types of variadic functions' arguments for functions like fcntl() and ioctl(). Unfortunately lint(1) will complain about them: in particular as one of the parameters is the function being tagged. For now define this attribute in the lint-sensitive section. Reference: http://clang.llvm.org/docs/AttributeReference.html#type-safety-checking
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r--sys/sys/cdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 553a899..1ffe0ab 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -212,6 +212,7 @@
#define __unused
#define __packed
#define __aligned(x)
+#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
#define __section(x)
#define __weak
#else
@@ -236,6 +237,12 @@
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
#endif
+#if __has_attribute(argument_with_type_tag)
+#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
+ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
+#else
+#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
+#endif
#if defined(__INTEL_COMPILER)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
OpenPOWER on IntegriCloud