From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [RFC 08/14] xen/xsm: flask: Rename variable "bool" in "b" Date: Wed, 12 Mar 2014 16:26:56 +0000 Message-ID: <53208AD0.8060606@citrix.com> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> <1394640969-25583-9-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlzv-0001q9-U0 for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 16:27:16 +0000 In-Reply-To: <1394640969-25583-9-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, Daniel De Graaf , stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On 12/03/14 16:16, Julien Grall wrote: > On ARM, the compilation is failing with the following error: > In file included from flask_op.c:21:0: > ./include/conditional.h:24:43: error: two or more data types in declaration specifiers > ./include/conditional.h:25:42: error: two or more data types in declaration specifiers > > Signed-off-by: Julien Grall > Cc: Daniel De Graaf I am curious as to why this works on x86. The name 'bool' is specified as an alias for '_Bool' by C99/stdboot.h ~Andrew > --- > xen/xsm/flask/include/conditional.h | 4 ++-- > xen/xsm/flask/ss/services.c | 14 +++++++------- > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/xen/xsm/flask/include/conditional.h b/xen/xsm/flask/include/conditional.h > index 043cfd8..9055340 100644 > --- a/xen/xsm/flask/include/conditional.h > +++ b/xen/xsm/flask/include/conditional.h > @@ -21,7 +21,7 @@ int security_set_bools(int len, int *values); > > int security_find_bool(const char *name); > > -char *security_get_bool_name(unsigned int bool); > -int security_get_bool_value(unsigned int bool); > +char *security_get_bool_name(unsigned int b); > +int security_get_bool_value(unsigned int b); > > #endif > diff --git a/xen/xsm/flask/ss/services.c b/xen/xsm/flask/ss/services.c > index aebbec7..59234ff 100644 > --- a/xen/xsm/flask/ss/services.c > +++ b/xen/xsm/flask/ss/services.c > @@ -1958,7 +1958,7 @@ out: > return rc; > } > > -int security_get_bool_value(unsigned int bool) > +int security_get_bool_value(unsigned int b) > { > int rc = 0; > unsigned int len; > @@ -1966,19 +1966,19 @@ int security_get_bool_value(unsigned int bool) > POLICY_RDLOCK; > > len = policydb.p_bools.nprim; > - if ( bool >= len ) > + if ( b >= len ) > { > rc = -ENOENT; > goto out; > } > > - rc = policydb.bool_val_to_struct[bool]->state; > + rc = policydb.bool_val_to_struct[b]->state; > out: > POLICY_RDUNLOCK; > return rc; > } > > -char *security_get_bool_name(unsigned int bool) > +char *security_get_bool_name(unsigned int b) > { > unsigned int len; > char *rv = NULL; > @@ -1986,16 +1986,16 @@ char *security_get_bool_name(unsigned int bool) > POLICY_RDLOCK; > > len = policydb.p_bools.nprim; > - if ( bool >= len ) > + if ( b >= len ) > { > goto out; > } > > - len = strlen(policydb.p_bool_val_to_name[bool]) + 1; > + len = strlen(policydb.p_bool_val_to_name[b]) + 1; > rv = xmalloc_array(char, len); > if ( !rv ) > goto out; > - memcpy(rv, policydb.p_bool_val_to_name[bool], len); > + memcpy(rv, policydb.p_bool_val_to_name[b], len); > out: > POLICY_RDUNLOCK; > return rv;