]> xenbits.xensource.com Git - xen.git/commit
xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 16 Sep 2015 19:57:27 +0000 (15:57 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 22 Sep 2015 16:09:03 +0000 (12:09 -0400)
commit6a2f81459e1455d65a9a6f78dd2a0d0278619680
treeb862a6a6c430654c85f594bfc5fa4904de7dc9ef
parent5790ef286377fae5682367ffe361bc35662a2ed2
xen/xsm: Make p->policyvers be a local variable (ver) to shut up GCC 5.1.1 warnings.

policydb.c: In function ‘user_read’:
policydb.c:1443:26: error: ‘buf[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         usrdatum->bounds = le32_to_cpu(buf[2]);
                          ^
cc1: all warnings being treated as errors

Which (as Andrew mentioned) is because GCC cannot assume
that 'p->policyvers' has the same value between checks.

We make it local, optimize the name to 'ver' and the warnings go away.
We also update another call site with this modification to
make it more inline with the rest of the functions.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xen/xsm/flask/ss/policydb.c