From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: RE: minor gcc4 fixes Date: Mon, 11 Apr 2005 14:44:26 -0500 Message-ID: <1113248666.5172.25.camel@thinkpad> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt Cc: xen-devel , Ian Pratt List-Id: xen-devel@lists.xenproject.org My explanation was a bit off (off like driving off a cliff), The problem is that GCC4 is seeing is that variable such as frame (in grant_table.c) is passed into a function without initialization. Again for the variable sl1mfn (in shadow.c) does the same thing. So really the patches should be: Signed-off-by: Jerone Young --- xen/common/grant_table.c.old 2005-04-11 14:41:49.000000000 -0500 +++ xen/common/grant_table.c 2005-04-11 14:42:30.000000000 -0500 @@ -311,7 +311,7 @@ __gnttab_map_grant_ref( struct exec_domain *led; u16 dev_hst_ro_flags; int handle; - unsigned long frame, host_virt_addr; + unsigned long frame = 0, host_virt_addr; int rc; /* Returns 0 if TLB flush / invalidate required by caller. --- xen/arch/x86/shadow.c.old 2005-04-11 14:38:51.000000000 -0500 +++ xen/arch/x86/shadow.c 2005-04-11 14:37:11.000000000 -0500 @@ -1594,7 +1594,7 @@ static inline unsigned long shadow_make_snapshot( struct domain *d, unsigned long gpfn, unsigned long gmfn) { - unsigned long smfn, sl1mfn; + unsigned long smfn, sl1mfn = 0; void *original, *snapshot; u32 min_max = 0; int min, max, length; On Mon, 2005-04-11 at 19:57 +0100, Ian Pratt wrote: > > These patches initialize unsigned longs that are used in xen. > > GCC4 complains about using unsigned longs that are not > > initialized before use. > > Are any of these actually bug fixes, or simply work arrounds for some > bizzare ggc4 behaviour? > > Ian > -- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157)