Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-13 Thread Jan Beulich
>>> On 13.02.19 at 11:28, wrote: > On 2/12/19 4:03 PM, Jan Beulich wrote: > On 12.02.19 at 16:32, wrote: >>> On 12/02/2019 15:26, Ian Jackson wrote: > But if we really want to have ptrdiff_t, then I think we should either > follow the uintptr_t model and use attribute((mode())),

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-13 Thread George Dunlap
On 2/12/19 4:03 PM, Jan Beulich wrote: On 12.02.19 at 16:32, wrote: >> On 12/02/2019 15:26, Ian Jackson wrote: >>> But if we really want to have ptrdiff_t, then I think we should either follow the uintptr_t model and use attribute((mode())), or we should leverage the compiler's

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Stefano Stabellini
On Tue, 12 Feb 2019, Jan Beulich wrote: > >>> On 12.02.19 at 02:13, wrote: > > --- a/xen/include/xen/types.h > > +++ b/xen/include/xen/types.h > > @@ -52,7 +52,8 @@ typedef __u32 __be32; > > typedef __u64 __le64; > > typedef __u64 __be64; > > > > -typedef unsigned int __attribute__((__mode__(_

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Jan Beulich
>>> On 12.02.19 at 16:32, wrote: > On 12/02/2019 15:26, Ian Jackson wrote: >> >>> But if we really want to have ptrdiff_t, then I think we should either >>> follow the uintptr_t model and use attribute((mode())), or we should >>> leverage the compiler's __PTRDIFF_TYPE__ (and then also >>> __UINTPT

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Jan Beulich
>>> On 12.02.19 at 16:26, wrote: > Jan Beulich writes ("Re: [PATCH v9 1/5] xen: introduce ptrdiff_t, fix > uintptr_t"): >> On 12.02.19 at 02:13, wrote: >> > -typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t; >> > +typedef unsigned long __attribute__((__mode__(__pointer__)))

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Andrew Cooper
On 12/02/2019 15:26, Ian Jackson wrote: > >> But if we really want to have ptrdiff_t, then I think we should either >> follow the uintptr_t model and use attribute((mode())), or we should >> leverage the compiler's __PTRDIFF_TYPE__ (and then also >> __UINTPTR_TYPE__ for uintptr_t, at least if avail

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Ian Jackson
Jan Beulich writes ("Re: [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t"): > On 12.02.19 at 02:13, wrote: > > -typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t; > > +typedef unsigned long __attribute__((__mode__(__pointer__))) uintptr_t; > > I don't understand this c

Re: [Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-12 Thread Jan Beulich
>>> On 12.02.19 at 02:13, wrote: > --- a/xen/include/xen/types.h > +++ b/xen/include/xen/types.h > @@ -52,7 +52,8 @@ typedef __u32 __be32; > typedef __u64 __le64; > typedef __u64 __be64; > > -typedef unsigned int __attribute__((__mode__(__pointer__))) uintptr_t; > +typedef unsigned long __attr

[Xen-devel] [PATCH v9 1/5] xen: introduce ptrdiff_t, fix uintptr_t

2019-02-11 Thread Stefano Stabellini
uintptr_t should be "unsigned long" -- same size as a pointer. Introduce the new type "ptrdiff_t" which is defined as the signed integer type of the result of subtracting two pointers. Signed-off-by: Stefano Stabellini CC: jbeul...@suse.com CC: andrew.coop...@citrix.com CC: julien.gr...@arm.com