Re: [libvirt] [PATCH] qemu: silence clang false positive

2011-08-11 Thread Eric Blake
On 08/11/2011 08:51 AM, Laine Stump wrote: On 08/05/2011 11:14 AM, Eric Blake wrote: } } else if (flags& VIR_DOMAIN_AFFECT_CONFIG) { + /* Clang can't see that if we get here, persistentDef was set. */ + sa_assert(persistentDef); + for (i = 0; i< nparams; i++) { virTypedParameterPtr param =¶ms[i]

Re: [libvirt] [PATCH] qemu: silence clang false positive

2011-08-11 Thread Laine Stump
On 08/05/2011 11:14 AM, Eric Blake wrote: Our logic throws off analyzer tools: ptr var = NULL; if (flags == 0) flags = live ? _LIVE : _CONFIG; if (flags& _LIVE) do stuff if (flags& _CONFIG) var = non-null; if (flags& _LIVE) do more stuff else if (flags& _CONFIG) use var the tools keep think

[libvirt] [PATCH] qemu: silence clang false positive

2011-08-05 Thread Eric Blake
Our logic throws off analyzer tools: ptr var = NULL; if (flags == 0) flags = live ? _LIVE : _CONFIG; if (flags & _LIVE) do stuff if (flags & _CONFIG) var = non-null; if (flags & _LIVE) do more stuff else if (flags & _CONFIG) use var the tools keep thinking that var can still be NULL in the last i