From owner-svn-src-all@FreeBSD.ORG Wed Apr 22 18:13:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BF5913F; Wed, 22 Apr 2015 18:13:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A9B511D7; Wed, 22 Apr 2015 18:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3MIDTSO003011; Wed, 22 Apr 2015 18:13:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3MIDTgW003010; Wed, 22 Apr 2015 18:13:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504221813.t3MIDTgW003010@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 22 Apr 2015 18:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281861 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2015 18:13:29 -0000 Author: pfg Date: Wed Apr 22 18:13:28 2015 New Revision: 281861 URL: https://svnweb.freebsd.org/changeset/base/281861 Log: 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 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Wed Apr 22 18:11:34 2015 (r281860) +++ head/sys/sys/cdefs.h Wed Apr 22 18:13:28 2015 (r281861) @@ -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__))