[Spice-devel] [PATCH] server/red_worker: fix used but uninitialized warning (gcc 4.6.0)

Alon Levy alevy at redhat.com
Tue Feb 8 12:53:53 PST 2011


On Tue, Feb 08, 2011 at 08:02:51PM +0200, Uri Lublin wrote:
> On 02/07/2011 03:11 PM, Alon Levy wrote:
> >---
> >  server/red_worker.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> >diff --git a/server/red_worker.c b/server/red_worker.c
> >index f899ff2..f163a71 100644
> >--- a/server/red_worker.c
> >+++ b/server/red_worker.c
> >@@ -6219,7 +6219,7 @@ static inline int drawable_depends_on_areas(Drawable *drawable,
> >      int i;
> >      RedDrawable *red_drawable;
> >      int drawable_has_shadow;
> >-    SpiceRect shadow_rect;
> >+    SpiceRect shadow_rect = {0, 0, 0, 0};
> >
> >      red_drawable = drawable->red_drawable;
> >      drawable_has_shadow = has_shadow(red_drawable);
> 
> OK.
> Just a note, this does not fix spice code, but is only needed due to
> gcc 4.6.0 imperfection.

Right, should have mentioned this - absolutely right, that variable only
gets used if it is initialized, which gcc 4.6.0 fails to notice. I could
probably file a bug on gcc :)


More information about the Spice-devel mailing list