xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Dushyant Behl <myselfdushyantbehl@gmail.com>,
	xen-devel@lists.xen.org
Subject: Re: Compilation Error in extras/mini-os/tpmback.c
Date: Thu, 17 Jul 2014 20:21:31 +0200	[thread overview]
Message-ID: <20140717182131.GC6456@type.youpi.perso.aquilenet.fr> (raw)
In-Reply-To: <1405502011.7019.3.camel@kazak.uk.xensource.com>

Ian Campbell, le Wed 16 Jul 2014 10:13:31 +0100, a écrit :
> On Wed, 2014-07-16 at 11:25 +0530, Dushyant Behl wrote:
> > I'm trying to compile xen from the source and i'm getting this
> > compilation error while running a make world.
> > 
> > tpmback.c: In function ‘tpmif_change_state’:
> > tpmback.c:350:4: error: format ‘%d’ expects argument of type ‘int *’,
> > but argument 3 has type ‘enum xenbus_state *’ [-Werror=format=]
> >     if(sscanf(value, "%d", &readst) != 1) {
> >     ^
> > cc1: all warnings being treated as errors
> > make[3]: *** [/home/corvo/gsoc/code/xen/stubdom/mini-os-x86_64-vtpm/tpmback.o]
> > Error 1
> > 
> > Could anyone explain that if this is just problem on my side or this
> > is not fixed in the git tree.
> 
> It looks like a legitimate issue to me. I expect you are just the first
> person to use a compiler which picks up in this particular issue.
> 
> I'm not sure what the correct fix is since C doesn't mandate very much
> about the storage size of an enum, so casting is probably not the right
> answer.

Indeed, C99 apparently says “The choice of type is
implementation-defined”, so

> Probably the value needs to be read into an actual int variable and then
> assigned to the enum.

that seems like the proper solution.

Samuel

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

  reply	other threads:[~2014-07-17 18:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  5:55 Compilation Error in extras/mini-os/tpmback.c Dushyant Behl
2014-07-16  9:13 ` Ian Campbell
2014-07-17 18:21   ` Samuel Thibault [this message]
2014-07-18  9:55     ` Ian Campbell
2014-07-18 10:01       ` Dushyant Behl
2014-07-18 10:09         ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140717182131.GC6456@type.youpi.perso.aquilenet.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=myselfdushyantbehl@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).