Re: [PATCH v3 1/1] x86, relocs: add printf attribute to die()

From: Ingo Molnar
Date: Thu Feb 02 2017 - 02:16:15 EST



* Nicolas Iooss <nicolas.iooss_linux@xxxxxxx> wrote:

> With %Ld, my compiler (gcc 6.3.1 on x86_64) complains:
>
> arch/x86/tools/relocs.c:400:7: error: format â%Ldâ expects argument of
> type âlong long intâ, but argument 2 has type âElf64_Off {aka long
> unsigned int}â [-Werror=format=]

How did it pick up that type as an 'unsigned long'? We have:

include/uapi/linux/elf.h:typedef __u64 Elf64_Off;

Even user-space has it as a pure 64-bit type:

/usr/include/elf.h:typedef uint64_t Elf64_Off;

Thanks,

Ingo