From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 24/29] libxl: Introduce FILLZERO Date: Wed, 1 Apr 2015 10:42:59 +0100 Message-ID: <1427881379.2115.259.camel@citrix.com> References: <1423599016-32639-1-git-send-email-ian.jackson@eu.citrix.com> <1423599016-32639-25-git-send-email-ian.jackson@eu.citrix.com> <1427198621.21742.372.camel@citrix.com> <21786.60580.482169.516456@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21786.60580.482169.516456@mariner.uk.xensource.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: Ian Jackson Cc: xen-devel@lists.xensource.com, Euan Harris List-Id: xen-devel@lists.xenproject.org On Tue, 2015-03-31 at 19:51 +0100, Ian Jackson wrote: > > > No callers yet, but document it in CODING_STYLE. (In accordance with > > > existing libxl policy, I haven't gone through all existing possible > > > call sites.) > > > > We don't usually expose such helpers in the public API, but I suppose > > you have a good reason to do so here, could you mention it in the commit > > log please. > > It should be in the public API because xl*.c is full of uses of memset > which ought to be replaced with FILLZERO. Do you really think I need > to mention this in the commit message ? I suppose not. > > > +#define LIBXL_FILLZERO(object) (memset(&(object), 0, sizeof((object)))) > > > > Evaluates object twice, so LIBXL_FILEZERO(*(p++)), would behave > > surprisingly. I'm not sure if this can be resolved though, so this might > > be a Don't Do That Then situation. > > sizeof() does not evaluate its argument. Useful!