From: Ian Campbell Subject: Re: [PATCH v2] tools/libxl: libxl_get_scheduler should return an int Date: Fri, 21 Mar 2014 12:43:51 +0000 Message-ID: <1395405831.19839.34.camel@kazak.uk.xensource.com> References: <1395404743-13833-1-git-send-email-julien.grall@linaro.org> 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 1WQyoE-0005la-5q for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 12:44:26 +0000 In-Reply-To: <1395404743-13833-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-03-21 at 12:25 +0000, Julien Grall wrote: > libxl_get_scheduler returns either a valid value in enum range or ERROR_FAIL. > > As function return type is an enum, chekcing if the value is negative will "checking" > be always false. Therefore both GCC and clang will never go to the error > case. Are there any API compatibility concerns here? I think there isn't because enum foo bar = get_foo() and int bar = get_foo() are both always valid whether get_foo() returns an enum foo or an int. So I think we can make this change without a LIBXL_HAVE define. Would be good to confirm and include the rationale in the commit log. Ian.