From owner-svn-src-all@freebsd.org Mon Jun 29 00:30:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4817598FC6A; Mon, 29 Jun 2015 00:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) 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 39ADF1C00; Mon, 29 Jun 2015 00:30:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T0UVXW046537; Mon, 29 Jun 2015 00:30:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T0UVQu046518; Mon, 29 Jun 2015 00:30:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201506290030.t5T0UVQu046518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 29 Jun 2015 00:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284917 - 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: Mon, 29 Jun 2015 00:30:31 -0000 Author: pfg Date: Mon Jun 29 00:30:30 2015 New Revision: 284917 URL: https://svnweb.freebsd.org/changeset/base/284917 Log: Add a new __sentinel attribute. The sentinel attribute was originally implemented in OpenBSD's gcc and later adopted by upstream GCC 4.0 (and clang). From the OpenBSD's gcc-local manpage: - gcc recognizes the extra attribute __sentinel__, which can be used to mark varargs function that need a NULL pointer to mark argument termination, like execl(3). This exposes latent bugs for 64-bit architectures, where a terminating 0 will expand to a 32-bit int, and not a full-fledged 64-bits pointer. While here sort the visibility attributes. Hinted-by: OpenBSD Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Jun 28 21:36:00 2015 (r284916) +++ head/sys/sys/cdefs.h Mon Jun 29 00:30:30 2015 (r284917) @@ -469,11 +469,13 @@ #endif #if __GNUC_PREREQ__(4, 0) -#define __hidden __attribute__((__visibility__("hidden"))) +#define __sentinel __attribute__((__sentinel__)) #define __exported __attribute__((__visibility__("default"))) +#define __hidden __attribute__((__visibility__("hidden"))) #else -#define __hidden +#define __sentinel #define __exported +#define __hidden #endif /*