From: Ian Jackson Subject: Re: [PATCH for-4.6 2/8] tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL Date: Wed, 29 Jul 2015 12:03:06 +0100 Message-ID: <21944.45802.553432.521705@mariner.uk.xensource.com> References: <1438119883-8083-1-git-send-email-andrew.cooper3@citrix.com> <1438119883-8083-3-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1438119883-8083-3-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper Cc: Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org Andrew Cooper writes ("[PATCH for-4.6 2/8] tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL"): > libxl__ao_inprogress_gc() is hidden behind various macros used to > construct local variables. Assert() that NULL is not passed, to make > such an error very obvious, rather than a plain segfault at 0. I'm not in general a huge fan of this approach. It can be unclear where it ends: should every function that requires non-null arguments assert all those arguments ? But (a) libxl__ao_inprogress_gc is a special case because one of its purposes is to check the state of the ao being dealt with and (b) the assert may help prevent an optimiser (perhaps a whole program optimiser) from doing something insane if it notices that a particular path always passes ao==0. So: Acked-by: Ian Jackson