From owner-svn-src-head@freebsd.org Tue Nov 10 15:08:06 2015 Return-Path: Delivered-To: svn-src-head@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 6FB62A2A8DD for ; Tue, 10 Nov 2015 15:08:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 4DC2E18BA for ; Tue, 10 Nov 2015 15:08:06 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Tue, 10 Nov 2015 15:08:12 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tAAF82w5003524; Tue, 10 Nov 2015 08:08:02 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1447168083.91061.2.camel@freebsd.org> Subject: Re: svn commit: r290613 - head/sys/compat/linuxkpi/common/include/linux From: Ian Lepore To: Hans Petter Selasky , Bruce Evans , "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 10 Nov 2015 08:08:03 -0700 In-Reply-To: <5641A056.2040805@selasky.org> References: <201511091650.tA9Gog7d061645@repo.freebsd.org> <20151110080516.M4088@besplex.bde.org> <5641A056.2040805@selasky.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 15:08:06 -0000 On Tue, 2015-11-10 at 08:44 +0100, Hans Petter Selasky wrote: > On 11/09/15 22:17, Bruce Evans wrote: > > On Mon, 9 Nov 2015, Conrad E. Meyer wrote: > > > > > Log: > > > linuxkpi/sysfs.h: Cast arg2 through intptr_t to avoid GCC > > > warning > > > > > > The code compiles fine under Clang, but GCC on PPC is less > > > permissive > > > about > > > integer and pointer sizes. (An intmax_t is clearly *large > > > enough* to > > > hold a > > > pointer value.) > > > > > > Another follow-up to r290475. > > > > This shouldn't compile either. > > > > Hi Conrad, > > > > static int > > -sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, > > intptr_t arg2, > > +sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, > > intmax_t arg2, > > struct sysctl_req *req, struct rm_priotracker *tracker) > > Given that the second argument is sometimes used for pointers, maybe > we > should keep it intptr_t. Or add a compile time assert that > sizeof(intmax) >= sizeof(intptr_t) which I think doesn't hold? > > --HPS > If intmax_t is the "maximum width integer type" and intptr_t is "integer type capable of holding a pointer", I think by definition sizeof(intmax_t) must be >= sizeof(intptr_t). On the other hand, given the perverse way standards-writers think, I'm not sure "big enough" is all it takes to qualify as "capable of holding a pointer". But I think in reality it'll work out right anyway. -- Ian