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

Re: [Xen-devel] [PATCH] Add missing return value checks



>>> On 12.08.13 at 14:41, Bastian Blank <bastian@xxxxxxxxxxxx> wrote:
> On Mon, Aug 12, 2013 at 09:24:59AM +0100, Jan Beulich wrote:
>> >>> On 11.08.13 at 22:10, Bastian Blank <bastian@xxxxxxxxxxxx> wrote:
>> > The return value of vasprintf must be checked. This check is enforced
>> > with the compiler options used in Debian by request and in Ubuntu by
>> > default.
>> The function is not declared with __attribute__((warn_unused_result)),
> 
> Depending on the compiler setup it is and has been this way since a long 
> time:
> 
> | #define __attribute_warn_unused_result__ __attribute__ 
> ((__warn_unused_result__))
> | #if __USE_FORTIFY_LEVEL > 0
> | # define __wur __attribute_warn_unused_result__
> | #endif
> | extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
> |                       _G_va_list __arg)
> |      __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;

Oh, I'm sorry, I grepped for in tools/, found

int vasprintf(char **buffer, const char *fmt, va_list ap);

in libxl, and concluded there's no attribute. Looking more closely,
this is only a backup declaration...

So yes, your patch is fine:

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


_______________________________________________
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®.