[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] mini-os: enable compiler check for printk format types



On 6 October 2014 14:28, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Sun, 2014-10-05 at 21:30 +0200, Samuel Thibault wrote:
>
>> > Samuel, are you ok with the patch after those clarifications?
>>
>> Yes.
>
> I interpreted this as an Acked-by, I hope that's ok, and was about to
> commit when:
> disk_read.c: In function 'vtpm_load_disk':
> disk_read.c:539:59: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 2 has type 'unsigned int' [-Werror=format]
> disk_read.c:539:59: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 4 has type 'unsigned int' [-Werror=format]
> disk_read.c:540:2: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 2 has type 'unsigned int' [-Werror=format]
> disk_read.c:540:2: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 3 has type 'unsigned int' [-Werror=format]
> disk_read.c:542:30: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 4 has type 'unsigned int' [-Werror=format]
> disk_read.c:545:47: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 2 has type 'unsigned int' [-Werror=format]
> disk_read.c:545:47: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 3 has type 'unsigned int' [-Werror=format]
> disk_read.c:545:47: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 4 has type 'unsigned int' [-Werror=format]
> disk_read.c:545:47: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
> disk_read.c:548:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 2 has type 'unsigned int' [-Werror=format]
> disk_read.c:548:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 4 has type 'unsigned int' [-Werror=format]
> disk_read.c:548:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 6 has type 'unsigned int' [-Werror=format]
> disk_read.c:551:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 2 has type 'unsigned int' [-Werror=format]
> disk_read.c:551:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 3 has type 'unsigned int' [-Werror=format]
> disk_read.c:551:21: error: format '%lu' expects argument of type 'long 
> unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
>
> That's on an x86_32 stubdom build.

What's the exact command I should use to test the builds? I did a
"make build" in "stubdom" in an x86_32 container and it worked*, but I
now see that doing "make" in the "stubdom/vtpmmgr" subdirectory gives
the above error.

* (after adding some symlinks to fix "xen-config-host.h:19:21: fatal
error: xenctrl.h: No such file or directory" error in "ioemu")

On 7 October 2014 17:04, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> wrote:
> Ian Campbell, le Mon 06 Oct 2014 14:28:50 +0100, a Ãcrit :
>> Looks like this is printing the output of sizeof. The correct modifier
>> for printing a size_t is %zu not hardcoded as a long. I haven't checked
>> if mini-os printf supports z.
>
> Yes it does, so it can be used.

It will also warn about a %lu that should be just %u in there.
With those changes, vtpmmgr builds for me.


-- 
Dr Thomas Leonard        http://0install.net/
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.