From: "Jan Beulich" Subject: Re: [PATCH] Add missing return value checks Date: Mon, 12 Aug 2013 14:28:21 +0100 Message-ID: <5208FF1502000078000EB33F@nat28.tlf.novell.com> References: <20130811201020.GA3460@mail.waldi.eu.org> <5208B7FB02000078000EB091@nat28.tlf.novell.com> <20130812124137.GA6153@mail.waldi.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V8sAc-0001Oz-Pe for xen-devel@lists.xenproject.org; Mon, 12 Aug 2013 13:28:26 +0000 In-Reply-To: <20130812124137.GA6153@mail.waldi.eu.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Bastian Blank Cc: ian.jackson@citrix.com, ian.campbell@citrix.com, xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 12.08.13 at 14:41, Bastian Blank wrote: > On Mon, Aug 12, 2013 at 09:24:59AM +0100, Jan Beulich wrote: >> >>> On 11.08.13 at 22:10, Bastian Blank 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 Jan