[Libguestfs] [PATCH 2/2] Cast return value of be64toh to uint64_t before printing.

Matthew Booth mbooth at redhat.com
Thu Dec 6 13:42:22 UTC 2012

On 06/12/12 13:32, Richard W.M. Jones wrote:
> From: "Richard W.M. Jones" <rjones at redhat.com>
> With glibc 2.16-24.fc18, be64toh is a macro around __bswap_64 which is
> defined as:
>    unsigned long long int __bswap_64 (unsigned long long int __bsx);
> Unfortunately on 64 bit platforms, unsigned long long int cannot be
> printed using the expansion of PRIu64 ("%lu") resulting in about a
> dozen errors such as:
>    ldm.c:1129:5: error: format '%lu' expects argument of type 'long unsigned int', but argument 11 has type 'long long unsigned int' [-Werror=format]
> This commit corrects the problem by casting the result to uint64_t,
> although I'm fairly sure that this is really a bug in glibc.
> ---
>   src/ldm.c | 28 ++++++++++++++--------------
>   1 file changed, 14 insertions(+), 14 deletions(-)

I already have this patch locally, but it seems I forgot to push it. 
Sorry! It's pushed now.

Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490

More information about the Libguestfs mailing list