From: Ian Jackson Subject: Re: [PATCH] tools/libxl: Fix build following c/s c3c8da9 Date: Mon, 29 Jun 2015 15:29:11 +0100 Message-ID: <21905.22071.234406.364753@mariner.uk.xensource.com> References: <1435581680-11989-1-git-send-email-andrew.cooper3@citrix.com> <21905.20904.334921.585121@mariner.uk.xensource.com> <559154B7.8030708@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <559154B7.8030708@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 ("Re: [PATCH] tools/libxl: Fix build following c/s c3c8da9"): > On 29/06/15 15:09, Ian Jackson wrote: > > Can you easily confirm that this fixes it ? > > It does indeed. Tested-by: Andrew Cooper > > However, the problem with this style is that it is subverted by: > > rc = libxl__datacopier_start(dc); > if (rc) goto out; > > out of context below, which cases rc to be initialised on all subsequent > error paths, and thus miss further issues where it is set incorrectly. Yes, I agree that this is less than ideal. It means that not all such uninitialised rc's will be found, but ... > I would suggest introducing another int to hold the temporary from > libxl__datacopier_start(). ... this would be quite inconvenient. The right answer IMO is to replace the idiom rc = some_function(...); if (rc) goto out; with a macro invocation CHECKING_RC( some_function(...) ); and maybe have a `goto out' macro, too GOTO_OUT_RC(FAIL); But I'm not sure my co-maintainers agree. Anyway, thanks for the tested-by. I will make a proper commit message etc. and apply my patch. Ian.