From: Ian Campbell Subject: Re: [PATCH] xen: correct definition of uintptr_t on 32-bit platforms. Date: Tue, 4 Jun 2013 15:42:11 +0100 Message-ID: <1370356931.24512.114.camel@zakaz.uk.xensource.com> References: <1370351784-13275-1-git-send-email-ian.campbell@citrix.com> <51AE0D2B02000078000DB1D0@nat28.tlf.novell.com> <1370354405.24512.107.camel@zakaz.uk.xensource.com> <51AE179702000078000DB241@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51AE179702000078000DB241@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: keir@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2013-06-04 at 15:36 +0100, Jan Beulich wrote: > >>> On 04.06.13 at 16:00, Ian Campbell wrote: > > On Tue, 2013-06-04 at 14:52 +0100, Jan Beulich wrote: > >> >>> On 04.06.13 at 15:16, Ian Campbell wrote: > >> > Currently uintptr_t is unsigned long for both 32- and 64- bit platforms but > >> > __PRIPTR_PREFIX is just "" on 32-bit leading to: > >> > > >> > error: format '%u' expects argument of type 'unsigned int', but > > argument > >> > 2 has type 'long unsigned int' [-Werror=format] > >> > > >> > It was a bit of a tossup between changing __PREPTR_PREFIX and changing the > >> > definition of uintptr_t. I went with the latter since it is consistent with > >> > glibc. > >> > >> Actually I would much prefer the format string prefix to be changed > >> - like Linux, we're assuming all over the place that pointer and longs > >> are equivalent in size, so creating an association between pointers > >> and ints is much more likely to cause problems than adjusting the > >> format string prefix. > > > > Can do that if you prefer. > > > > Would this just push the problem into the code which is compiled for > > both user and hypervisor space (e.g. libelf), uintptr_t would then be > > different in the two environments. I haven't tried it so I don't know > > what the practical impact is. > > In user environment the print format should be taken from the > standard C headers just as the uintptr_t definition ought to be. > No risk of collision if done consistently. Yes, absolutely. I was thinking more of "assignment from incompatible... " type errors, where fixing one case would break the other... Ian.