[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] minor gcc4 fixes



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 <jyoung5@xxxxxxxxxx>

--- 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@xxxxxxxxxx
512-838-1157 (T/L: 678-1157)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.