xfs
[Top] [All Lists]

Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __

To: Felix Janda <felix.janda@xxxxxxxxx>
Subject: Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 13 Jan 2016 09:02:40 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160112214634.GC10558@nyan>
References: <cover.1452627740.git.felix.janda@xxxxxxxxx> <20160112195935.GB568@nyan> <20160112212405.GL10456@dastard> <20160112214634.GC10558@nyan>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jan 12, 2016 at 10:46:34PM +0100, Felix Janda wrote:
> Dave Chinner wrote:
> > On Tue, Jan 12, 2016 at 08:59:35PM +0100, Felix Janda wrote:
> > > The uint*_t and int*_t are defined by C99 and should be prefered
> > > over the less portable __uint*_t and __int*_t variants. The
> > > necessary <stdint.h> include is in platformdefs.h, which gets
> > > included in most places via libxfs.h. In the public headers
> > > <stdint.h> is included in <xfs/xfs_types.h>.
> > > 
> > > Signed-off-by: Felix Janda <felix.janda@xxxxxxxxx>
> > 
> > I can't apply this straight off. Most of the libxfs code that is
> > changed is shared with the kernel code, and so the definitions of
> > the variables need to be the same as the kernel code. There are
> > reasons for the kernel code using __[u]int*_t type variants (e.g.  I
> > think the endian conversion static checker requires the __ variants
> > for host order variables), and so before making sweeping changes
> > like this we need to ensure that we can make the equivalent changes
> > to the kernel code as well...
> 
> Thanks for the review!
> 
> Sorry, I was not aware about this difference between the types.
> 
> The simplest fix for musl would be to add defines or something similar
> to linux.h.
> 
> On the other hand, on the long run it would be preferable to use
> the stdint types (consistently).

Right, that's definitely the better solution. We can't just jump
there in one go. :/

FWIW, changing everything outside libxfs/ and include/ should be ok
to do straight away; it's just the libxfs stuff that we have other
constraints on.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>