From: Ian Campbell Subject: Re: Build errors with latest xen-unstable from staging Date: Mon, 7 Feb 2011 09:47:02 +0000 Message-ID: <1297072022.13091.753.camel@zakaz.uk.xensource.com> References: <4D4EF01F.5050106@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4D4EF01F.5050106@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Kamala Narasimhan Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Sun, 2011-02-06 at 19:01 +0000, Kamala Narasimhan wrote: > FYI - Pulled the latest xen-unstable from staging to sync some patches = and got > these trivial errors while compiling - >=20 > xl_cmdimpl.c: In function =E2=80=98print_domain_vcpuinfo=E2=80=99: > xl_cmdimpl.c:3351: warning: =E2=80=98firstset=E2=80=99 may be used unin= itialized in this function > xl_cmdimpl.c:3351: note: =E2=80=98firstset=E2=80=99 was declared here > xl_cmdimpl.c:3350: warning: =E2=80=98bitmask=E2=80=99 may be used unini= tialized in this function > xl_cmdimpl.c:3350: note: =E2=80=98bitmask=E2=80=99 was declared here > xl_cmdimpl.c:3350: warning: =E2=80=98pmap=E2=80=99 may be used uninitia= lized in this function > xl_cmdimpl.c:3350: note: =E2=80=98pmap=E2=80=99 was declared here >=20 > GCC version - 4.2.4. Initializing the three variables it complained ab= out fixed > the issue. They are actually initialised before use, during the first pass through the for loop when i=3D=3D0 and state=3D=3D0, but I can see how gcc would = be unable to figure that out (in fact I'm not sure about firstset myself). In the Linux kernel they have a macro to annotate such instances: /* * A trick to suppress uninitialized variable warning without gen= erating any * code */ #define uninitialized_var(x) x =3D x =20 Do we want something similar? > If this trivial change should require a signed off line, here it is > - Signed-off-by: Kamala Narasimhan Always just assume a change does. Ian. >=20 > diff -r 7ada6faef565 tools/libxl/xl_cmdimpl.c > --- a/tools/libxl/xl_cmdimpl.c Sun Feb 06 17:26:31 2011 +0000 > +++ b/tools/libxl/xl_cmdimpl.c Sun Feb 06 13:53:50 2011 -0500 > @@ -3347,8 +3347,8 @@ static void print_bitmap(uint8_t *map, i > static void print_bitmap(uint8_t *map, int maplen, FILE *stream) > { > int i; > - uint8_t pmap, bitmask; > - int firstset, state =3D 0; > + uint8_t pmap =3D 0, bitmask =3D 0; > + int firstset =3D 0, state =3D 0; >=20 > for (i =3D 0; i < maplen; i++) { > if (i % 8 =3D=3D 0) { >=20 > Kamala >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel