Re: [PATCH spice-common] spice.proto: fix uninitalized variable in demarshaller

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

 



It would be nice to fix the generator to use full names (including the name of the owning struct) for these variables (e.g. u_foo for members of the outer 'u' struct and u_u_foo for members of the inner 'u' struct).  I spent some time looking at the generator code and experimented a bit with it, but concluded that it wasn't really worth my time.  If there's somebody else that's familiar enough with this code to fix it easily, it'd be a nice fix.  Otherwise I'm perfectly OK just working around this limitation like you've done in this patch.

jonathon


----- Original Message -----
> From: "Alon Levy" <alevy@xxxxxxxxxx>
> To: spice-devel@xxxxxxxxxxxxxxx
> Sent: Tuesday, October 22, 2013 9:05:03 AM
> Subject: Re:  [PATCH spice-common] spice.proto: fix uninitalized variable in demarshaller
> 
> On 10/22/2013 04:47 PM, Alon Levy wrote:
> > Our automatically generated marshallers use temporary variables whose
> > name is based on the field, without checking for shadowing. This bites
> > us in one location that is fixed by this patch. A better solution would
> > be to fix the marshaller, but it's more then I want to bite right now.
> s/marshaller/generator/
> 
> I'll fix it before pushing.
> 
> > 
> > RHBZ: 1021995
> > ---
> >  common/messages.h | 2 +-
> >  spice.proto       | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/common/messages.h b/common/messages.h
> > index a8a0eee..8ca5385 100644
> > --- a/common/messages.h
> > +++ b/common/messages.h
> > @@ -542,7 +542,7 @@ typedef struct SpiceMsgcTunnelAddGenericService {
> >      uint64_t description;
> >      union {
> >          SpiceMsgTunnelIpInfo ip;
> > -    } u;
> > +    } u2;
> >  } SpiceMsgcTunnelAddGenericService;
> >  
> >  typedef struct SpiceMsgcTunnelRemoveService {
> > diff --git a/spice.proto b/spice.proto
> > index 04e7ea4..b4920f5 100644
> > --- a/spice.proto
> > +++ b/spice.proto
> > @@ -1210,7 +1210,7 @@ channel TunnelChannel : BaseChannel {
> >  	switch (type) {
> >  	case IPP:
> >  	    TunnelIpInfo ip @ctype(SpiceMsgTunnelIpInfo);
> > -	} u;
> > +	} u2;
> >      } @ctype(SpiceMsgcTunnelAddGenericService) service_add = 101;
> >  
> >      message {
> > 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]