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

Re: [Xen-devel] [PATCH] tools/xen-detect: try sysfs node for obtaining guest type



Wei Liu writes ("Re: [Xen-devel] [PATCH] tools/xen-detect: try sysfs node for 
obtaining guest type"):
> On Wed, Jun 21, 2017 at 04:24:33PM +0200, Olaf Hering wrote:
> > On Thu, Jun 15, Juergen Gross wrote:
> > > +++ b/tools/misc/xen-detect.c
> > 
> > > +        asprintf(&ver, "V%u.%u",
> > > +                 (uint16_t)(regs[0] >> 16), (uint16_t)regs[0]);
> > 
> > > +        asprintf(&ver, "V%s.%s", str, tmp);
> > 
> > This fails to build:
> > 
> > xen-detect.c:196:17: error: ignoring return value of 'asprintf', declared 
> > with attribute warn_unused_result [-Werror=unused-result]
> > xen-detect.c:93:17: error: ignoring return value of 'asprintf', declared 
> > with attribute warn_unused_result [-Werror=unused-result]
> 
> Hmm... your gcc seems to be rather strict. :-)

gcc is correct.

asprintf can fail if its malloc fails.

Ian.

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

 


Rackspace

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