[syslinux] Get rid of printf format warning format ???%llx??? expects type ???long long unsigned int???, but argument 2 has type ???uint64_t???

Geert Stappers stappers at stappers.nl
Sun Jan 25 11:48:27 PST 2015


On Sat, Nov 22, 2014 at 01:36:45PM +0100, Martin Str|mberg wrote:
> Hello.
> 
> Use <inttypes.h> PRIx64 instead of llx to get rid of gcc warning
> format ???%llx??? expects type ???long long unsigned int???, but argument 2 has type ???uint64_t???
> 
> 
> --
> MartinS
> 
> diff --git a/com32/gpllib/acpi/xsdt.c b/com32/gpllib/acpi/xsdt.c
> index 208abc6..228b6c3 100644
> --- a/com32/gpllib/acpi/xsdt.c
> +++ b/com32/gpllib/acpi/xsdt.c
> @@ -63,7 +63,7 @@ int parse_xsdt(s_acpi * acpi)
>  
>  	    /* Let's grab the pointed table header */
>  	    char address[16] = { 0 };
> -	    sprintf(address, "%llx", *p);
> +	    sprintf(address, "%" PRIx64 , *p);
>  	    uint64_t *pointed_address = (uint64_t *)strtoul(address, NULL, 16);
>  
>  	    x->entry[x->entry_count] = pointed_address;
> diff --git a/com32/hdt/hdt-cli-memory.c b/com32/hdt/hdt-cli-memory.c
> index c05b7cd..7d0342c 100644
> --- a/com32/hdt/hdt-cli-memory.c
> +++ b/com32/hdt/hdt-cli-memory.c
> @@ -47,7 +47,7 @@ static void show_memory_e820(int argc __unused, char **argv __unused,
>      more_printf("BIOS-provided physical RAM e820 map:\n");
>      for (int i = 0; i < count; i++) {
>  	get_type(map[i].type, type, 14);
> -	more_printf("%016llx - %016llx %016llx (%s)\n",
> +	more_printf("%016" PRIx64 " - %016" PRIx64 " %016" PRIx64 " (%s)\n",

          <snip/>

For the sake of the archive:
Patch is applied in the Development git repository of Gene.

@Martin: Thank you for your contribution to Syslinux.



Cheers
Geert Stappers
Who now can unmark 'follow-up' of November 2014 message
------------- volgend deel ------------
Een niet-tekst bijlage is gescrubt...
Naam: signature.asc
Type: application/pgp-signature
Grootte: 836 bytes
Omschrijving: Digital signature
URL : <http://www.zytor.com/pipermail/syslinux/attachments/20150125/31625c8c/attachment.sig>


More information about the Syslinux mailing list