* minor gcc4 fixes
@ 2005-04-11 18:36 Jerone Young
0 siblings, 0 replies; 3+ messages in thread
From: Jerone Young @ 2005-04-11 18:36 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
These patches initialize unsigned longs that are used in xen. GCC4
complains about using unsigned longs that are not initialized before
use.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
--
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)
[-- Attachment #2: gcc4_fix_1.diff --]
[-- Type: text/x-patch, Size: 522 bytes --]
--- xen/common/grant_table.c.old 2005-04-11 12:02:40.000000000 -0500
+++ xen/common/grant_table.c 2005-04-11 12:03:37.000000000 -0500
@@ -311,7 +311,8 @@ __gnttab_map_grant_ref(
struct exec_domain *led;
u16 dev_hst_ro_flags;
int handle;
- unsigned long frame, host_virt_addr;
+ unsigned long host_virt_addr = 0;
+ unsigned long frame = 0;
int rc;
/* Returns 0 if TLB flush / invalidate required by caller.
[-- Attachment #3: gcc4_fix_2.diff --]
[-- Type: text/x-patch, Size: 442 bytes --]
--- xen/arch/x86/shadow.c.old 2005-04-11 12:04:20.000000000 -0500
+++ xen/arch/x86/shadow.c 2005-04-11 12:05:41.000000000 -0500
@@ -1594,7 +1594,8 @@ static inline unsigned long
shadow_make_snapshot(
struct domain *d, unsigned long gpfn, unsigned long gmfn)
{
- unsigned long smfn, sl1mfn;
+ unsigned long smfn = 0;
+ unsigned long sl1mfn = 0;
void *original, *snapshot;
u32 min_max = 0;
int min, max, length;
[-- Attachment #4: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: minor gcc4 fixes
@ 2005-04-11 18:57 Ian Pratt
2005-04-11 19:44 ` Jerone Young
0 siblings, 1 reply; 3+ messages in thread
From: Ian Pratt @ 2005-04-11 18:57 UTC (permalink / raw)
To: Jerone Young, xen-devel
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: minor gcc4 fixes
2005-04-11 18:57 minor gcc4 fixes Ian Pratt
@ 2005-04-11 19:44 ` Jerone Young
0 siblings, 0 replies; 3+ messages in thread
From: Jerone Young @ 2005-04-11 19:44 UTC (permalink / raw)
To: Ian Pratt; +Cc: xen-devel, Ian Pratt
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@us.ibm.com>
--- 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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-11 19:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-11 18:57 minor gcc4 fixes Ian Pratt
2005-04-11 19:44 ` Jerone Young
-- strict thread matches above, loose matches on Subject: below --
2005-04-11 18:36 Jerone Young
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.