This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: statx struct's stx_size pointer compatibility with uint64_t/size_t
- From: David Howells <dhowells at redhat dot com>
- To: Dominique Martinet <asmadeus at codewreck dot org>
- Cc: dhowells at redhat dot com, linux-api at vger dot kernel dot org, libc-alpha at sourceware dot org, Quentin Bouget <quentin dot bouget at cea dot fr>, Jeff Layton <jlayton at kernel dot org>, Florian Weimer <fweimer at redhat dot com>
- Date: Tue, 17 Dec 2019 18:17:59 +0000
- Subject: Re: statx struct's stx_size pointer compatibility with uint64_t/size_t
- References: <20191217165350.GA10729@nautica> <87r213aykv.fsf@oldenburg2.str.redhat.com> <20191217152154.GB25518@nautica>
Dominique Martinet <asmadeus@codewreck.org> wrote:
> Looking at this from a kernel's point of view, it looks like there
> really was a will to simplify 64-bit ints handling over all arches and
> have them all define 64-bit ints as long long a few years back.
Think printk() too. Do you use "%lu", "%Lu" or "%llu"? It's a lot easier if
__u64 is consistently unsigned long long - then it's always "%llu".
The problem with defining it as "unsigned long" on some platforms and
"unsigned long long" on others is that you're guaranteed warnings on one arch
or another.
David