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
This commit is contained in:
pfg 2015-04-22 18:13:28 +00:00
parent 90d0d1c5a5
commit f527cebd54

View File

@ -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__))