Srinivas Maturi
2008-Feb-27 20:08 UTC
[Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
We are seeing build failure of xen-unstable for the last couple of changesets, in tools/blktap/drivers for block-qcow2.c This seems to be because of the fact that the compile line uses these flags, -Werror -Wno-unused, treating warnings as errors and aborting the compilation. The Makefile in tools/blktap/drivers has these CFLAGS set: CFLAGS += -Werror CFLAGS += -Wno-unused gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Werror -Wno-unused -I../../../tools/libxc -I../../../tools/include -I ../../libaio/src -I.. -I../lib -I../../../tools/include -I. -I../../xenstore -D_GNU_SOURCE -Wp,-MD,.block-qcow2.o.d -c -o block-qcow2.o block-qcow2.c cc1: warnings being treated as errors block-qcow2.c: In function ‘qcow2_create’: block-qcow2.c:1312: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result block-qcow2.c:1314: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result block-qcow2.c:1319: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result block-qcow2.c:1322: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result block-qcow2.c:1325: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result block-qcow2.c: In function ‘qcow_write_compressed’: block-qcow2.c:1354: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result ..... ..... Thanks, Maturi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Feb-28 10:27 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
Which version of gcc are you using? It works for me with 3.4.4 and 4.1.1. Properly speaking we should check those write() return values anyway. If we don''t want to deviate from the qemu original sources that much then we could special-case CFLAGS to remove -Wno-unused for just that file. -- Keir On 27/2/08 20:08, "Srinivas Maturi" <srinivas.maturi@oracle.com> wrote:> > We are seeing build failure of xen-unstable for the last couple of > changesets, > in tools/blktap/drivers for block-qcow2.c > > This seems to be because of the fact that the compile line > uses these flags, -Werror -Wno-unused, treating warnings as errors > and aborting the compilation. > > The Makefile in tools/blktap/drivers has these CFLAGS set: > CFLAGS += -Werror > CFLAGS += -Wno-unused > > gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions > -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -m64 > -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wno-unused-value -Wdeclaration-after-statement -m64 > -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wno-unused-value -Wdeclaration-after-statement -m64 > -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ > -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -m64 -fno-strict-aliasing > -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value > -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE > -D_LARGEFILE64_SOURCE -m64 -fno-strict-aliasing -std=gnu99 -Wall > -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement > -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -m64 > -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes > -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ > -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Werror -Wno-unused > -I../../../tools/libxc -I../../../tools/include -I ../../libaio/src -I.. > -I../lib -I../../../tools/include -I. -I../../xenstore -D_GNU_SOURCE > -Wp,-MD,.block-qcow2.o.d -c -o block-qcow2.o block-qcow2.c > cc1: warnings being treated as errors > block-qcow2.c: In function qcow2_create¹: > block-qcow2.c:1312: warning: ignoring return value of write¹, declared > with attribute warn_unused_result > block-qcow2.c:1314: warning: ignoring return value of write¹, declared > with attribute warn_unused_result > block-qcow2.c:1319: warning: ignoring return value of write¹, declared > with attribute warn_unused_result > block-qcow2.c:1322: warning: ignoring return value of write¹, declared > with attribute warn_unused_result > block-qcow2.c:1325: warning: ignoring return value of write¹, declared > with attribute warn_unused_result > block-qcow2.c: In function qcow_write_compressed¹: > block-qcow2.c:1354: warning: ignoring return value of ftruncate¹, > declared with attribute warn_unused_result > ..... > ..... > > > Thanks, > Maturi > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kevin Wolf
2008-Feb-28 12:14 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
> Properly speaking we should check those write() return values anyway. If we > don''t want to deviate from the qemu original sources that much then we could > special-case CFLAGS to remove -Wno-unused for just that file.Shouldn''t -Wno-unused disable the check rather than enabling it? Removing it causes even more warnings. Maturi''s compiler just seems to ignore that switch. I could compile the code with both gcc 4.1.2 and 4.3.0 without any such problems. Kevin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kevin Wolf
2008-Feb-28 12:37 UTC
[Xen-devel] [PATCH] blktap: Fix unused warnings in block-qcow2.c
Kevin Wolf schrieb:> Shouldn''t -Wno-unused disable the check rather than enabling it? > Removing it causes even more warnings. Maturi''s compiler just seems to > ignore that switch.I see, it''s the -D_FORTIFY_SOURCE=2 which causes the warnings. This is not enabled in the standard xen-unstable Makefiles, so we could not reproduce it. The fix is trivial: These warning are all in functions which are used only by qemu, but not by blktap. Just drop them. Kevin Signed-off-by: Kevin Wolf <kwolf@suse.de> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Feb-28 13:02 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
On 28/2/08 12:14, "Kevin Wolf" <kwolf@suse.de> wrote:>> Properly speaking we should check those write() return values anyway. If we >> don''t want to deviate from the qemu original sources that much then we could >> special-case CFLAGS to remove -Wno-unused for just that file. > > Shouldn''t -Wno-unused disable the check rather than enabling it? > Removing it causes even more warnings. Maturi''s compiler just seems to > ignore that switch. > > I could compile the code with both gcc 4.1.2 and 4.3.0 without any such > problems.Oh yes, silly me. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Srinivas Maturi
2008-Feb-28 18:59 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
Keir Fraser wrote:> Which version of gcc are you using? It works for me with 3.4.4 and 4.1.1. >We are using gcc 4.1.2. Thanks, Maturi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kevin Wolf
2008-Feb-29 08:18 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
Srinivas Maturi schrieb:> We are using gcc 4.1.2.Ok. As I wrote the problem is not with the compiler version but with your compiler switches, namely -D_FORTIFY_SOURCE=2. Keir has commited my patch already, so please try the latest xen-unstable. Kevin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Srinivas Maturi
2008-Feb-29 18:38 UTC
Re: [Xen-devel] xen-unstable build failure in tools/blktap/drivers for block-qcow2.c
Kevin Wolf wrote:> Srinivas Maturi schrieb: > >> We are using gcc 4.1.2. >> > > Ok. As I wrote the problem is not with the compiler version but with > your compiler switches, namely -D_FORTIFY_SOURCE=2. Keir has commited my > patch already, so please try the latest xen-unstable. > > >The build succeeded with changeset 17152. Thanks for the patch. Thanks, Maturi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel