From: Bastian Blank Subject: Re: [PATCH] Add missing return value checks Date: Mon, 12 Aug 2013 14:41:38 +0200 Message-ID: <20130812124137.GA6153@mail.waldi.eu.org> References: <20130811201020.GA3460@mail.waldi.eu.org> <5208B7FB02000078000EB091@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V8rRN-0007bA-RK for xen-devel@lists.xenproject.org; Mon, 12 Aug 2013 12:41:41 +0000 Content-Disposition: inline In-Reply-To: <5208B7FB02000078000EB091@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: ian.jackson@citrix.com, ian.campbell@citrix.com, xen-devel List-Id: xen-devel@lists.xenproject.org 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; Bastian -- There's another way to survive. Mutual trust -- and help. -- Kirk, "Day of the Dove", stardate unknown