From: Gianni Tedesco Subject: Re: [PATCH]: minios: eliminate compile warning - use of uninitialised variable Date: Tue, 11 Jan 2011 12:25:11 +0000 Message-ID: <1294748711.12018.123.camel@qabil.uk.xensource.com> References: <1294419169.12018.79.camel@qabil.uk.xensource.com> <20110107165822.GX5820@const.bordeaux.inria.fr> <1294420919.12018.89.camel@qabil.uk.xensource.com> <20110107192759.GA5418@const.famille.thibault.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20110107192759.GA5418@const.famille.thibault.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault Cc: Xen Devel , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2011-01-07 at 19:27 +0000, Samuel Thibault wrote: > Gianni Tedesco, le Fri 07 Jan 2011 17:21:59 +0000, a =C3=A9crit : > > On Fri, 2011-01-07 at 16:58 +0000, Samuel Thibault wrote: > > > Gianni Tedesco, le Fri 07 Jan 2011 16:52:49 +0000, a =C3=A9crit : > > > > I'm not sure if this is a legit catch by gcc or a false positive = due to > > > > extra cleverness in gcc-4.5. Either way it causes the build to ba= rf. > > >=20 > > > It seems a false positive to me. What is the warning message? > >=20 > > lib/math.c:197:22: error: =E2=80=98tmp.ul[1]=E2=80=99 may be used uni= nitialized in this function > > lib/math.c:153:11: note: =E2=80=98tmp.ul[1]=E2=80=99 was declared her= e > >=20 > > I figured it was a false positive but looking at it now, maybe not? >=20 > Oooh, is this perhaps on a 64bit machine? There is actually a bug: thes= e > should be ints, not longs... Use this instead. >=20 > Samuel >=20 > Replace long/int/short sizes with proper exact-size types for 64bit > architectures. >=20 > Signed-off-by: Samuel Thibault >=20 > diff -r a33886146b45 extras/mini-os/lib/math.c > --- a/extras/mini-os/lib/math.c Fri Oct 08 11:41:57 2010 +0100 > +++ b/extras/mini-os/lib/math.c Fri Jan 07 20:26:34 2011 +0100 Yep, works for me... Gianni