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

Re: [Xen-devel] Mini-os fbfront.c unused variable complaint



On Wed, 2012-02-08 at 07:19 +0000, Keir Fraser wrote:
> On 08/02/2012 14:15, "Ian Campbell" <Ian.Campbell@xxxxxxxxxx> wrote:
> 
> > On Mon, 2012-02-06 at 19:05 +0000, John McDermott CIV wrote:
> >> Xen Developers,
> >> 
> >> FWIW, in trying to compile mini-os on Xen 4.1.2, I get a variable set
> >> but not used warning for variable 'message' in function init_kbdfront.
> >> (Looks like another one just like it, in function init_fbfront, from
> >> the same file.) My source won't compile with these warnings. I could
> >> not find a patch for this in xen-4.1-testing.hg Xenbits.
> > 
> > This new, enabled by default, compiler warning is very annoying, even
> > though it happens to be correct. Which distro has done it? (or maybe
> > it's just new enough gcc which is to blame).
> 
> We should be disablign this warning in Config.mk, where we add
> -Wno-unused-but-set-variable to CFLAGS. Perhaps mini-os needs to do the
> same, if it is creating its own CFLAGS? Note that we add it in Config.mk via
> $(call cc-option-add ...) because older gcc versions do not have this
> warning.

I imagine that would look like the following, John does this work for
you?

On the other hand although this compiler warning is annoying these
particular ones do seem to be real issues worth fixing, if only to
improve the error reporting.

Ian.

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328778190 0
# Node ID 72db20f4f6389649680e13d8ad6d96b5ed9d576f
# Parent  7f2a3ca9d749c65336aca04617bb0a038445fb49
mini-os: Add -Wno-unused-but-set-variable when compiling mini-oss too.

Disabled for the main Xen build in 23368:0f670f5146c8 but mini-os has it's own
CFLAGS.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 7f2a3ca9d749 -r 72db20f4f638 extras/mini-os/minios.mk
--- a/extras/mini-os/minios.mk  Thu Feb 09 09:03:10 2012 +0000
+++ b/extras/mini-os/minios.mk  Thu Feb 09 09:03:10 2012 +0000
@@ -9,6 +9,7 @@ debug = y
 DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format 
-Wno-redundant-decls
 DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
 DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+DEF_CFLAGS += $(call cc-option,$(CC),-Wno-unused-but-set-variable)
 DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
 DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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